#help-development
1 messages · Page 905 of 1
^
yours too >:( wanna fight buddy huh huh !?!
I do insist, your opinion is not really well based on facts and it just looks like you’re arguing for the sake of arguing, but you do you
you're entirely right, I don't have anything better to do, though I still consider it's based on facts
compare it to a language like golang
in what way do you compare the two?
also important: based on
start me 2 concurrent threads. one randomly reads from a file and the other randomly writes to the same file
What’s the purpose?
synchronized ¯_(ツ)_/¯
This for instance is completely factless, i don’t know what to tell you
I mean sure not all features are that crucial to the languge
But that point can be given to any modern language
No like, what exactly are you comparing?
Just “oh pick 2 langs and compare them” is really vague
is it speed?
stability comfort?
modularity?
https://www.baeldung.com/java-17-new-features see pattern matching, sealed classes, vector api
https://www.baeldung.com/java-12-new-features see switch expressions, instanceof matching
simplicity of use
maintainability of code
readability of code
You can write highly maintainable code and highly readable code in Java
as well as in GoLang
Simplicity java falls
that's what I'm mostly referring to though!! having 5 ways of doing a single thing is silly and automatically leads to less readable and maintainable code
no matter what the language is
I, as a developer, should not have to know what the fuck it means when someone assigns a switch statement to a variable
that’s true, but java is at least trying to not provide 5 ways of doing the same thing, they’re trying to provide dev ergonomics, which yes a side effect is sometimes that you get surjectivity
well brunnooo
Would you rather have java never update again?
Or what exactly do you value?
Java never pushing any new JEPs just so you don’t have to learn any new semantic feature? Or let Java try their best to ergonomically simplify the language to some extent, syntax sugar or whatever you wanna call it?
simplify?
ergonomic just isn't a good word to use because it's the polar opposite of that
ah yeah instanceof pattern matching wasnt a simplification
simplification to write and not to read and maintain
especially for new developers
you are able to preserve good ergonomics and readability while having one standard method of doing something
my example language, golang, kind of excels at that
and don't get me wrong, even though I'm criticizing java fwiw, I'm not saying it should NEVER BE USED and is USELESS GARBAGE
java is absolutely amazing in some aspects
but golang wouldn't have been created by Google "just cuz they felt like it"
it was created because google noticed the aforementioned flaws in java (which was along with c++ the primary language they wrote almost everything in) especially when trying to maintain huge codebases with lots of developers at different levels of experience involved
never said anything about that, a language may update without introducing more useless syntax crud under the excuse of "developer ergonomics"
there are constant useful updates to java
and also constant useless updates to java
sure I would probably not use java anymore for a micro service, but there are def other sections where I think Java is far more applicable
if you dont consider javas features ergonomical then thats on u, the reason we for example got pattern matching was because it was largely asked for from the community, then whether you classify it as simplicity, ergonomics or what other term is up to u Ig, it is true that GoLang wins in simplicity (and other aspects), but don't you reckon its worth for java to satisfy its community and try to reduce some of its unnecessary semantics, its not like these features are shipped in a week, it has been years for them to be delivered, subsequently well established and learnt/adopted by the community (mostly)
but if you so much care about having one objective way of doing things in programming that'll surely eliminate a lot of languages from ever being touched by your hands rest assured 
Let's stop arguing and switch to Kotlin 
:D
make them sit on chairs with an IED under them that is hooked up to a web server and whoever writes a program to detonate the other's chair wins the argument
this is the only way
the issue is constantly trying to satisfy the community
xD
rust suffers from that issue the most
rust is like the exact problems I'm talking about in java amplified a thousand times
conclusion: use C
well with rust u know u likely r gonna have to write it all urself pretty much but yea indeed
id consider it a double edged sword, tho
Stop writing code, manually change the state of each transistor instead
yeah no you're right
if you don't like java go join the very long list of people who said they'd make their own java and then did
it's important to find a balance but also stand up against EVERYTHING the community wants
and another 5 years from now we'll just have another flavor out
yup^^
I don't want to make my java
thanks xD
well then either use something else or suck it up, there is no other option for you here
well maybe go get hired by oracle is an option
never said there was one
I criticized its flaws
that's all!
don't misinterpret me
I never said anything about not wanting to use it
rust is so loose with merging PRs for no real reason and look at what that's led to
I can see that. The problem is that C++ is a real horror to write and there is not really an alternative other than Rust.
"the community" is a mass of people (people are mostly dumb)
and they follow whatever is cool and trendy at any given moment
so they just have to add crud to their favorite language implementing it
and then developers start using those new features, confusing those who still haven't picked up on them and making everything shittier and less maintainable
then in 10 years the feature gets deprecated and breaks tons of existing code
kotlin is bad
kotlin is just fake java still bytecode
I'm not gonna argue lol it's pointless
well, not always
I don't really take it as arguing but more of a convo
xD
it can be transpiled to javascript or sth weird
okay?
yep, now you know its not all fake jvm bytecode
I tried it. I liked it for scripting but puked while writing a big project with 2 other devs.
java has a nicer syntax tbh
i heard its annoying as its not rly 1-1 if u wna use it for both lets say on the jvm and the js web thingy
extends is more readable than :
I thought the same until I tried it
It is more verbose. And i like that in languages.
isnt kotlin just a different syntax?
i personally do like extends/implements, but i can see why u'd prefer : instead
Kotlin helps you not violate ocp iykwim
lol
I mean you could makw this argument for ever coding language
OMG
-.-
Yeah I'm not letting that go
not really, some have better generics than java
"better"
java has that, no im coping now^^^
Actually those are called templates 
Generics is a weak point in java. I prefer C#s approach for this.
it's only human when something is criticized about something you like
mfw just use clojure
What's different? Genuine question
yeah I +1 this
i think theres no type erasure
though I don't know anything about c# generics
C# is if kotlin and java had a malformed baby but it was owned by the most skull emoji company on earth
skullemoji
Lmao
as if oracle wasn't a skullemoji company
Unfortunately I'll have to concede that C# is pretty awesome even though Microsoft owns it
being born from the nsa
Listen I won't miss a beat to shit on Microsoft
C# is not bad though I don't want to learn a third java-esque language tbh
so sad sun is gone
you know it's fucked when 'several people typing...'
yeah same
Especially in help development
public void > fun
You know it's gonna get hella productive
this is actually ironically the one thing I DESPISE about go
isnt just java but weird naming conventions in essence? 🤨
go has a func too and it sucks
Mostly yes
But I think it's a bit less boilerplate as well
Yeah there's some cool features java doesn't have though
Jeah C# also has some truly horrible features. The language is fine but the eco system of this language
lets me use Java instead, which makes the choice easy. (Other then game dev ofc)
What is dependency management like in c#?
ye y2k and zbll, its pretty much more swag than java :c
nuget
God the only thing that turns me off of C is fucking CMake fuck CMake
c dependency management is miserable
but otherwise it's an ok language when applicable to the use case
is the eco sys rly that bad?
Hmm. I only use NuGet and whatever Unity uses internally.
Its... ok.
i found it just fine in most cases
I've seen some thiiiings that I won't for-gett..
😬
ashtray carpets & starving pets
The C# eco system is littered with deprecated, outdated and incompatible resources. It can create dumpster fires quite quickly.
yeah no the shit that people do with it is horrendous at times. I think it's mostly because of inexperienced developers whose first contact with programing is c# because it's so common in gamedev where so many people get into programming
just like python! not the gamedev part though. just new devs
but kotlin is so fun!
The problem is that C# went through a lot of fundamental changes in the attempt to separate itself from Java.
And during those changes there was a lot of stuff written, which now drags the eco system a bit behind.
no it not readable without the access modifier and return type for my java eyes
And that as well
i mean u can write accessiblity modifier and return type in kotlin as well
if u really feel like it
2 ways of doing the same thing.. my golang senses are tingling
suspend fun
lol
Python has a similar problem, but there you dont care. You already know that if you have something
that takes X and gives you Y, then you really dont want to know (and care) whats behind this function as long as it works.
emily why is there a nokotlin emoji on the paper server
does paper hate kotlin?
I feel like the paper people would worship it
why?
They are in a weird super position where they like Gradle but dislike Kotlin mostly
maven is nice
i think paper is using kotlin instead of groovy for gradle stuff (which is obvious why)
else java
as bruno mentioned earlier, the semantic surjectivity to solve a problem is a big issue in most kotlin code basas imo - often multiple ways of achieving the exact some thing for even the smallest code snippets
Maven is ok. As long as you dont need any custom functionality.
Gradle is more flexible, but the surjectivity is just pumped to the max there.
public fun 💀
what sort of fun are we talking about here
gradle is also at like version 8.5, who knows how many more versions we're gonna get
8.6 now iirc
mhmm yess
I found maven to bottle neck me when I needed to build some basic stuff out e.g. using python scripts instead of just building something small in buildSrc
well u can use type tokens also
can you combine python scripts with java code?
Blind casting!!!!!!!
if u want runtime type awareness
what r type tokens?
No I mean yess with jython but if you do that kinda like idk how to say this nicely but fuck you
why combining languages = bad? you can use the best of these 2 ?
basicallt a
abstract class Token<T> {}
where u create a new anonymous class
Token<Map<String,Object>> myToken = new Token<Map<String,Object>>(){};
and the type is preserved at runtime Map<String,Object>
The best of python is a scripting language far removed from anything you'd make in Java
yeah python is kinda slow
the only time py isnt slow is when its not in py
i heard python is so slow because the code is interpreted at runtime, why do you make a language intentionally slow?
Most of the big libraries you use are In C and if you optimize with CPython you kinda do some good shit my main problem with CPython is ide support is ass
Pythons goal isn't to be fast
It doesn't need to be the next C
It does what it wants to do and does it well
and what does it do?
it lets u write python code
nice

A fast to write interpreted language that is useful for writing scripts and modeling ML/AI models as well as CLIs
python is easy and quick (and slow and messy and a pain in the ass)
i mostly just hate the fake type system
java is easy too, so i dont see the reason behind python
yeahh same
python
print("hello")
java
package net.oikei.example;
public static void main(String[] args) {
System.out.println("hello");
}
??
Yeah but you're a programmer the overhead for a regular person or a professional who doesn't code to learn something like Java or C++ is huge they don't get paid to write code they get paid to do research crunch numbers etc python is a means to an end that's easy as fuck
clearly... latter wins
Because you are a programmer you'll never actually realize the true benefits if python and it's sad but makes sense
does it mean ppl who use python arent programmers?
Many aren't
Some are
Generally you'll see python being common in other fields like machine learning, statistics (tho R is also very widely used), even biology
ok
@river oracle plz check stash inbox
tell me whether i messed up the merge, there's a duplicate commit but it's just amended to sign it off since i didn't initially
kotlin beats them all
If programming isn't what makes you a programmer, what is?
Programmer socks
html
posting programming memes from 2004 in #general
also on the next episode find out why lifting weights doesn't make you a weightlifter
My main qualifications for that in a work environment would for that to be the most major part of your job
For many researchers that just isn't the case it's a helpful side piece
the way you phrased this sentence makes my head hurt
English 
I think I've forgotten how the debugger is supposed to work
this new intellij interface is tripping me up
wasn't there a play button for hotloading
I actually have no memory of how my hotloading setup was supposed to work, all I have is muscle memory from what used to work
@echo basalt packet-based async display entities, are you happy now
No
Its a keybind now iirc
I'm spawning custom entities. Is it enough to tag the custom entity via a persistent data container tag, or should I store the location of each custom entity and search for them that way.
I was thinking the storing of locations is redundant because I can simply mark each entity with a custom tag in PDC and just identity them that way.
pdc tag is enough
hey @echo basalt have you ever come up with a fixed-location abstract inventory system such that interacting with a spot in a world basically opens a chest but the chest doesn't actually exist?
That's hella niche
yeah a bit
But probably
just wondering if it's worth bothering hacking into mc to fake a chest being at a location for this or if I just do it the potentially easier way of dumping it into a database
pdc is a cute idea
Just have 1 inventory instance
Interaction entity
that's just for interaction though, not for inventory storage right
Sure but you can just map it to an inventory
yeah still need to figure out storage for that inv is all
how did you do that??
i wanted to do that with different inventories
voodoo magic
does anyone know how to handle a zombie spawn packet in protocollib?
also have to figure out how I want to store the chunk entity data for this one, not an obvious one
guys i installed the 1.8.8 version for fawe jar and getting this error on paper can someone help me?
like i cant find that jar anywhere else
?whereami
@torn shuttle Explain how it works!
Did you know this is spigot and also 1.8.8 is ancient
look at the time it's time to hit the gym
i actually tried both
guess you'll have to go read my open source code
what did the gym do to you
im glad to
you got a link?
like i have been spending around 10 hours to find a solution..
it pretty obviously says the plugin.yml file is invalid
ikr
for which part of htis
have you downloaded fawe for your version? (1.8.8)
it looked at me funny
with a reason
I'm coming for you after the gym
?
agreed
why do i get this error?
https://pastebin.com/Wjs1fAgj
This is my code for the event it doesnt register the kill and doesnt give a heart to the player that killed the other player
https://pastebin.com/jLQgbPQM
Just got home, still need help?
The error literally tells you the line n stuff
So does your IDE
On a side note, your code looks really ugly, please take a look at this
(It's pinned)
why doesnt anything happen when i select a head?
code
https://pastebin.com/8BSfcci2
dont use inventory holders to detect if its your inventory
then what do i use?
?gui
and add debug statements and see where it fails
ok
yes
current code is: https://paste.gg/p/anonymous/73779318512b4a4588f7ba650c62ce6e
I want to make the client think that a zombie is a player
how do I change the metadata correctly so that it is like a player's
Hm what's the objective with this?
Players and zombies are two very different things
to make the zombie look like a player
why doesnt this unban command work?
Bukkit.getServer().getConsoleSender().sendMessage("7 Debug");
BanList banList = Bukkit.getServer().getBanList(BanList.Type.NAME);
Bukkit.getServer().getConsoleSender().sendMessage("8 Debug");
if (banList.isBanned(Objects.requireNonNull(Objects.requireNonNull(offlinePlayer.getPlayer()).getName()))) {
Bukkit.getServer().getConsoleSender().sendMessage("9 Debug");
banList.pardon(offlinePlayer.getName());
Bukkit.getServer().broadcastMessage(ChatColor.YELLOW.toString() + ChatColor.BOLD + player.getName() + " Has Revived " + offlinePlayer.getName());
} else {
player.sendMessage(ChatColor.RED + "Player is not Dead!");
}
}
}```
I had the code for the fake player's nms but they don't have ai and goals
retexure
ItemStack nmsStack = CraftItemStack.asNMSCopy(is);
try {
Field f = Item.class.getDeclaredField("MAX_STACK_SIZE");
f.setAccessible(true);
f.setInt(nmsStack, i);
Field f2 = Item.class.getDeclaredField("maxStackSize");
f2.setAccessible(true);
f2.setInt(nmsStack, i);
} catch (Exception ex) {
ex.printStackTrace();
}
nmsStack.setCount(i);```
(1.20.1 paper)
How to make the number of items exceed 64?
When I run the above code, I see 64 items in my inventory and when I click, I pick up 100 items in my cursor.
can someone pls help
I think I don't have to consider the item duplication issue because it's just to be displayed in the GUI?
(I don't know if I understood it correctly)
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
it doesnt unban the player
but it doesnt output an error
i dont know whats wrong
Is there a obfuscator plugin in IntelliJ?
?
What exactly are you looking for
if you're trying to obfuscate while building with artifacts that's just a bad idea
I'd like to display 100 of nether stars on the GUI
Anyone knows why this happens?
if obfuscate, do it after building, but you better just don't obfuscate
What would be the event priority that runs slightly before monitor?
ItemStack nmsStack = CraftItemStack.asNMSCopy(is);
try {
Field f = Item.class.getDeclaredField("d");
f.setAccessible(true);
f.setInt(nmsStack, 100);
nmsStack.setCount(100);
} catch (Exception ex) {
ex.printStackTrace();
}```
Don’t you have to change the max stack size as well?
I remember in old bukkit you could set the item amount to anything, even tho it it limited by mc itself to 127
I wonder if you can do -128
I think mc patched stack sized over 64.
maxstacksize is obfuscated to "d"
I think not so long ago there was a bug with bottles in the brewing stand
but if you pick up an item, it'll be picked up as 100
And when I put it back in the inventory, it turns into 64.
the client doesn't like stacks above 64
is HIGHEST event priority called first, or last?
Because it doesnt really explain in the documentation what "important" means
yeah
Ok thanks
what if I do
we will come for you
then do it now
@icy beacon you say you live in my walls, come, fight me for this
I HAVE FINALLY FINISHED THE SCHOOL PROJECT
Well almost
What decides which plugins are loaded first?
I have yet to fill the database
But since I'm extremely happy
I hereby free you from your debt
isn't it the startup mode in plugin.yml, loadbefore and something like that and then also a bit of randomness
you what
You do not have any fact debt anymore
And as such you can opt out from being a fact provider now
You have 2 hours to decide
Hi uhh, i have a question what is a good structure to create a KitEditor system? :
- KitEditorProfile (UUID,KIT)?
- a database with UUID, SWORD INT,BOW INT ... etc?[i will get more problems with this system what if kit have consumable items , or thorwable items..]
.. any other ideas?
the user will execute /KitEditor , it will open the gui with the current kit items only , and he can manuplate the slot of the kit items .
Are you ever gonna query or insert just the sword, or just the bow etc
If not, maybe it could be worth while to blob it, altho yes - it does defeat the point of sql
Hey so i was just trying to load old project from eclipse to intelij. i failed so i moved out the old project folder out of the IdeaProjects. now im trying to create new project and im getting stuck on this screen each time. i tried invalidate and restart, deleted kotlin plugin. please help
it will be diffrent items ,and will be like sword , arrow , food , or custom items .. so each kit will be diffrent
how do i disable vanilla criticals?
does the java synchronized keyword enforce atomic access to the instance referenced in its parameter when invoked like ```java
synchronized(foo) {}
i found the docs only mentioning synchronized methods but it "appears" to work like this too
it only enforces atomic access to any code block that is synchronized on foo too. other code would still be able to access foo without being synchronized ofc
i expected as much that i would need to wrap every access to foo in the synchronized scope then
that is not thread safe
🙏
?
am i the only one who hates smooth scrolling
it slows down your scroll for no reason
to just look good
Yes, synchronized ensures mutual exclusion and acts like a visibility point
Tho I rarely touch synchronized since usually you got better tools to work with that make ur design more robust or are lighter in terms of performance
Yea, this is one of the reasons why synchronized sometimes is mediocre to work with, you may need to expose the mutex object to said clients enforcing them to manage it
spamming it across everything to solve concurrency is a smart move 
you need to be put in jail for that

⛓️
Guys my multi threaded number adder is broken
how do you create a redstone lamp but change its state so its turned on or off
is it possible for torch too?
Lever
change if its powered or not
really
so torch that isnt placed on a wall can be turned off but a wall torch cant
wait nvm
Sad, I was reading through that code in the image
In which kind of context would you use this?
i have a few data objects instead of one big one, when i want to access data this would be helpful, so i have it all in one class instead of getting it from some weird place
I'm having a hard time imagining it. I assume you will use some class Foo with some data and store it in the dataManagers map.
Then when you want to get Foo from that specific data holder you'll use #get?
yes, the datamanager save all the coin data for example, and i want to save the managers too as they became too many
and it became tedious working with them
So it's a manager for storing managers?
no its a registry storing all instances of said managers
it doesnt manage anything
it just stores them
true, my wording there was not precise
yes, i was going to use classes as keys, but javas cool feature type erasure makes that really not enjoyable
Wouldn't #getCanonicalName be safer? Tbh, probably doesn't matter
i dont know what these all even return tbh
it would be safer probably as i might in some extremely rare case have 2 classes with the same name in the register
iirc #getName returns the Name of the class, as is defined; #getCanonicalName returns the "path" to the class with the packages, e.g. com.conorsmine.net.Foo with Foo being the class.
Don't quote me on that, best to read the docs or just test it out
okay
getName returns the path, getSimpleName returns the actual name of the class
Thanks for clarifying :D
would this return a random uuid always, or would i generate it once?
it's a static field so once
and when i call new Object on an object that implements the interface it receivers its own uuid, so this concept works, right?
no
That's exactly what static does
tied to the interface, which will not re-instantiate it's static fields
okay, nice
Display entities and resource pack
?paste
but olivo, when i create a new object with new generics is it still the same class? as the definition of the object is different?
So basically i am making plugin that will replant fully grown crops if harvested after 3 seconds of being harvested but it doesnt really replant it to be fully grown it doesnt even replant it at all so there is no errors or anything like that in console but if someone could check it out
yes
is there any way i can achieve my goal with an interface?
or do i need to add to every class manually
use an abstract class instead
i suppose i could do that, tho what i my class already extends something ?
You can only extend one class at a time
thats why im asking, so theres no way of achieving this with an interface?
hey there. im trying to upload my plugin to the github. im following this tutorial https://www.spigotmc.org/threads/upload-your-code-to-github-intellij.223201/. problem is i cant see some buttons in version control system. like this one in the image. there is no Import into version control
no
it just looks like this
That's settings
version control is in settings isnt it?
and this one
how do i set path to git executable
theres no button in there
Found this one
but where is this one
nvm found that too
there a dirty ways to bypass this, very dirty that i will not share
why do you tell me about this, if you are not willing to tell me how? :(
Incredibly dirty, its your choice todo so. I suggest you do change your code structure though.
You could store a map, with the instance as the key and the value being the uuid. when executing getUUID it grabs the instance and saves it. if it exists in the instance, get it.
Once again, its incredibly dirty. I recommended you change your code structure
@worldly ingot am updating epic's TranslationKey PR and I'm confused is there some specific way you are supposed to get translation keys from registry backed things? I've noticed with 2 of your mentions notably, Biome and MusicalInstrument their registry backing, BaseBiome and Instrument have no mention of a msgId or descriptionId which have been the internal names I've come across for translations
okay, thank you i will think about how i can implement it
What's up with you and adding static methods to interfaces? You seem to be treating interfaces in a way they shouldn't be treated with
what's wrong with that code? I'm curious myself as a java newb :P
the correct way to approach this is
public interface Identifiable {
UUID getIdentity();
}
oh yes and then the class that implements it should do it
I was thinking of extends instead
In most cases interfaces shouldn't contain static methods. There are exceptions - yes, but I can't think of many
More often than not you should be using the default keyword instead
alternatively if you want to enforce a random UUID which I personally wouldn't you can use an abstract class
public abstract class Identifiable {
private final UUID identity = UUID.randomUUID();
@NotNull
public UUID getIdentitiy() {
return this.identity;
}
}
yerp ^
hmm, i have the problem that i need to get a objects identity while not having the object
then you have yourself a major design problem
And fields on interfaces are also rather rarely appropriate (the exception that comes to mind to this rule is ASM's Opcodes class, but that is just an interface for the sake of brevity rather than OOP reasons)
So - is there an object in the first place to get the identity of?
lol generic hell
no way in hell I'm helping with that xD
what are you trying to make?
KVKVT<><>>><<>>>>>>><
Looks like a generic registry
its a registry to registers datamanagers
i need to somehow get them without having the object
i need a key
if you want registries you should do something like this
here is an implementation
:nokotlin: :P
isn't the key your java/lang/Class instance?
though the fact you are making a RegistryRegistry from the looks of it is quite funny
unless DataManager isn't really a manager
datamanager manages data, and there are so many it became tideous
no that doesnt work cuz of generic hell
what kind of data?
playerdata
why do you have more than 1 player data class
i have it split up for when i load it offline so i dont load it all
So, what's the key then?
many classes = good offline loading
i dont need to load the coins if i want to see their rank
I don't understand, are you trying to get an object by a key when you don't have said key..?
In SLAPI we use a dedicated class for all registry keys: https://github.com/Starloader-project/Starloader-API/blob/future/2x/src/main/java/de/geolykt/starloader/api/registry/RegistryKeys.java, a similar principle could apply to you too
i need some kind of key
this ladies and gents is why you go raw on the SQL because I think you could write a SQL query to solve this problem in like 10 minutes
wdym raw in sql?
no complex generic fanagaling required!!!
But, honestly if the only reason you cannot use java/lang/Class is generic hell - then you actually can make use of java/lang/Class
blargh :P
no ORMs no overlapping api
overlapping api?
just going raw on that good OL SQL and java.sql
i dont know what you mean
im just splitting the data
so its more effiecient and also cleaner
I never had a problem with storing data the conventional way cough https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/common/PresenceData.java#L213-L332
yes why should i make a god class that has every playerdata and manages it all?
i dont have a problem either, having a singleton dataregistry is just nicer :)
managing your data is not a "God Class" its just called managing your data
if you have data relating to 1 plugin in your plugin
there is no god its just like idk basic data management
write some SQL queries you need and such
God classes are perfectly fine
no
Anyone that disagrees is an enemy of progress
they arent readable
actually it violates some obsucre OOP principle probably
That is what IDEs are fore
What? Are you really going to chop up random classes for no good reason?
idk usually that what OOP is all about
muh ocp
lol
yeah like OCP :trollface:
yo guys why are you bullying me :(
@inner mulch anyways putting each piece of data in a separate class is absolutely wild as fuck and is not efficent not any more readable. I'd argue its just dumb lol
I suppose, I think it better to have a EconomyData, RankData etc.
have you tried pdc? (/j)
the real solution here is to make what you call a "God Class" for your data and you'll want to make some SQL queries that are able to fulfill your requests e.g. pull top 10 richest players you can write a query for that
and the loading and unloading mechanims can be modified to the needs
what pdc?
xD
what does this have to do with sql
Data classes are just fancy wrappers for SQL data
or database data
Why do algorithm impls on tutorial websites have the worst names possible
Like the variables are like I l j
oh my god its supposed to be i j k not i l j wtf
@river oracle well, usually what I do is spawn a pig and give it a name so it doesn't despawn, then get its pdc and store all my data in nbt there
yes
it's quite clean but sometimes I have to have an alt online next to it so it doesn't unload and keep it in an enclosure so it doesn't escape
tbf usually they're just arbitrary numbers that count upwords
any idea why this doesn't work? doesn't make any sense
String slot = hand_data.get(new NamespacedKey(this, "slot"), PersistentDataType.STRING);
Bukkit.broadcastMessage(slot + "");
//slot broadcasts "MAINHAND", it works every time
if(slot == "MAINHAND"){
//somehow this doesn't work? the code doesn't get here
return hand_data.get(new NamespacedKey(this, "health"), PersistentDataType.DOUBLE);
}
okay ty
a bit of java weirdness for you
yeah it must feel like a mess coming from a simple language like that lol
yh lol
anyways ty o/
don't speak too soon, test that first xD
== is reference equality, .equals is value equality; you'd have to call .intern() on slot for it to work with ==
yeah the two Strings are actually different
their text might be the same but they can't be directly compared
because String is not a primitive type in java like boolean, int, or byte, the two Strings are different separate objects
it's a whole class, iirc in java.lang
it works its alr
I want MMO core support to be added to a plugin. Is there anyone who can do this?
I think it makes sense
What's the price
for someone coming from any other programming language ever, no it (initially) doesn't
what does support mean?
I wanted theSkills plugin to detect the ids of myhticmob creatures, who can I get this done?
So basically i am making plugin that will replant fully grown crops if harvested after 3 seconds of being harvested but it doesnt really replant it to be fully grown it doesnt even replant it at all so there is no errors or anything like that in console but if someone could check it out
are you trying to hire someone to do it for you or asking how to do it yourself?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
if the former is the case #help-development maybe isn't the best place to ask
Hello ! I have this error in my console with spigot 1.17.1 when I attack a giant and I move too far away. There are no other plugins on the server and the plugin only spawns the mob.
My Code :
public class TestMob extends EntityGiantZombie {
public TestMob(final World w, String name, float health, double speed, double damage, double range, boolean grief, boolean projectile) {
super(EntityTypes.G, ((CraftWorld)w).getHandle());
}
protected void initPathfinder() {
this.bQ.a(1, new PathfinderGoalMeleeAttack(this, 0.5, true));
this.bQ.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, false));
}
public TestMob spawn(final Location loc) {
this.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
((CraftWorld)loc.getWorld()).getHandle().addEntity(this, CreatureSpawnEvent.SpawnReason.CUSTOM);
return this;
}
}
And the giant is removed from the world
anyone know why?
Does anybody know I can make players unable to extinguish themselves with water? EntityConbustEvent doesn't trigger for this interaction and a constant check wouldn't work at all
¸ok
is this fish not a WaterMob
what tf
on PlayerFishEvent
this is also false for fishes
then what tf is a WaterMob
you want to prevent players from burning or ?
subinterfaces: Fish
what is Fish
is it Raw Cod? or what
i guess it isnt? xD
Itemstacks are not entities
since instanceof gives me false
prevent player from stop burning by touching water
can someone help me with java in general i dont understand something with setting environment variables for java
you can check if player has placed water to extinguish or you can check blocks around player and check if there is any water 🤷🏻♂️
Until you drop them on the ground
so if I check event.getCaught() instanceof Fish
would be better
getCaught is an entity
Hi, i'm trying to make bot with node-minecraft-protocol
how can i join bungeeserver with packets ?
can't use /server command
maybe use original minecraft protocol and you can use other libraries to send packets if you dont know how to do it yourself
thats really interesting lol
I'm using the minecraft protocol, but to send a packet to the bungee cord to reach the server I want, what should the packet look like?
did you check on here https://wiki.vg/Protocol
also do you really need to send packet or you can literally just do it in plugin create channel and send 2 strings to bungee
I can't add a plugin to the server
checking for water around a player for this is so inconsistent
just trying to help because i see nobody else gives a f**k
🤷🏻♂️
but i don't know how to implement that in javascript
well really i have never tried to do this but i believe it shouldnt be much different than just following tutorial on how to communicate with bungeecord server for example to send player to another server
you most likely just need to send 2 parameters like shown in tutorial
why are you so weird
here
😂
blocked
this one
try to use this as you can see how it is writing utf to ByteArrayDataOutput connect and then server name which is from config of bungee
is there an event for this? when show creates these piles of sand?
wild guess would be BlockFormEvent
i just want one additional thread to communicate with a database without blocking the servers main thread
and have the 2 threads communicate via a shared data structure
async be like
and thats where id use atomic operations
thats still on the main thread tho?
if its in the context of spigot
I mean, coms with a DB are hard off the main thread if you need to ensure e.g. order
or you need the value back
yay cache
yay cache indeed
Pee is stored in the cache
ive been told awhile back by alot of ppl that the bukkitrunnable is sheduled but not actually multithreaded
depends entirely on how you run it
Regular tasks are run on the main thread
tho I'd argue, BukkitRunnable is not what you want to use anyway
Async ones are run in a thread pool
my idea was to simply use the java Thread class
I mean, what would that give you tho ?
CompletableFuture my love
a Thread
A thread that works away on a queue for DB tasks ?
hush it woman
yes?
I mean, sure ?
fire and forget isn't the worst idea I guess but becomes ugly for reads
then you just end up smacking CompletableFutures into it
i didnt think about how the threads communicate yet
the closest idea i have are pipes
but
i dont even know if java has access to that
threads themselves don't communicate
Emily enters the chat
they just perform some work
you do the communication (or use a framework that provides the communication means)
CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> {
// DO SOMETHING
return "HHELLO";
}
future.whenComplete((result, ex) -> {
if ex != null theres error handle it cancel
result is now HHELLO and your back on the main thread
});
at which point, yea you'Ll just end up with a weird impl of CompletableFuture
and can probably just use that from the get go
there is rarely any benefit if at all in using Threads and queues directly
unless you are the one building the framework lol
if database querys get large and the db gets large the load on the mainthread will increase enough to cause lag spikes
Mhm
thats why you do it off the main thread, eg with futures
And if it’s some nerd with a MySQL database in another country then… yeah
Insert delay at 150ms
[insert meme here]
@EventHandler
public void onMenuClick(InventoryClickEvent menuClicked) {
Player player = (Player) menuClicked.getWhoClicked();
ShopData shopData = playerShopData.get(player);
int clickedSlot = menuClicked.getSlot();
boolean sendMessage = true;
ShopSetupStage setupStage = this.playerSetupStage.get(player);
if (clickedSlot == 3) {
// Currency setup
this.playerSetupStage.put(player, ShopSetupStage.CURRENCY_INPUT);
player.sendMessage(ChatColor.YELLOW + "Enter the item type for currency in the chat. Valid currencies: " + validCurrencies);
} else if (clickedSlot == 4) {
// Price setup
this.playerSetupStage.put(player, ShopSetupStage.PRICE_INPUT);
player.sendMessage(ChatColor.YELLOW + "Enter the amount for the price in the chat. (Maximum: 64)");
} else if (clickedSlot == 6) {
// Finalize Shop button
if (shopData != null && shopData.isShopComplete()) {
// Check if the shop is complete
this.playerSetupStage.put(player, ShopSetupStage.COMPLETE);
player.sendMessage("Shop created at: " + player.getLocation());
} else {
// Notify the player if the shop is not complete
this.playerSetupStage.put(player, ShopSetupStage.NONE);
player.sendMessage(ChatColor.RED + "Shop is not complete. Please set currency and price first.");
sendMessage = false; // Set to false to prevent sending the message twice
}
} else {
sendMessage = false; // Set to false for other cases where no message should be sent
}
if (sendMessage) {
menuClicked.setCancelled(true); // Cancel the click event to prevent issues
player.closeInventory(); // Close inventory to avoid potential issues
}
}
Anyone know why the messages are being sent twice when I click currency input or price nput items?
Nothing else in the class sends twice, I think it's enums or I'm somehow calling it twice
hi
hello
is the method itself being called twice?
also keep in mind that method iwll be called for every inventory
It’s just one gui menu
I triple checked and I can’t find any
Other buttons don’t send duplicate messages
how come you are closing the inv for slot 6 but not the others
when it prompts a chat input
the hwole sendMessage boolean doesnt seem necessary
Hello, I'm starting to despair, I made a scoreboard, but I have the problem that as soon as I join, my rank is no longer displayed above my head and in the tab list.
Scoreboard:
public static Scoreboard getBaseScoreboard(Player player) {
String display = "#0021E0A#0F30E3v#1E40E6e#2D4FE9r#3360EEu#3072F3m#2C84F8M#2996FDC";
Scoreboard s = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = s.registerNewObjective("test", "dummy", Color.formatHexColor(display));
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
objective.getScore("§7 ").setScore(12);
objective.getScore("§8▶ §9Name").setScore(11);
objective.getScore("§8➜ §e" + player.getName()).setScore(10);
objective.getScore("§1 ").setScore(9);
objective.getScore("§8▶ §9Rang").setScore(8);
objective.getScore("§8➜ §rAdmin").setScore(7);
objective.getScore("§6 ").setScore(6);
objective.getScore("§8▶ §9Coins").setScore(5);
objective.getScore("§3 ").setScore(3);
objective.getScore("§8▶ §9Shop").setScore(2);
objective.getScore("§8➜ §eTesting").setScore(1);
Team team = s.registerNewTeam("Coins");
team.addEntry(ChatColor.AQUA + "" + ChatColor.RED);
objective.getScore(ChatColor.AQUA + "" + ChatColor.RED).setScore(4);
team.setPrefix("§8➜ §e" + "TEst");
return s;
}
To set it I do this in the join event
player.setScoreboard(ScoreboardUtils.getBaseScoreboard(player));
the rank above your head uses teams aswell
you will have to use the same team
Even when I remove teams I have the same problem
Restart
Look
oh boy i love type erasure
when targeting a movingblock over a certain y value it just wont go there like its too high or sm, how do i fix this
"it just wont go there"??
what won't
the falling block is being shot from a location, 1, 1, 1 for example, and im shooting it to the location 10, 50, 10, for example, the fallingblock just wont go above a certain y level
Hi guys
teams are scoreboard related, are you sure that the teams are registered in the new scoreboard? (also you spelled rank wrong in the sidebar)
Is there any way to disable the particles generated by the rockets when used together with the elytras or when used with right click? I've been looking for how to do it and I can't find any way.
Yes, I'm sure the rank is correct since it's in German
How can I set an Item in Stonecuter (In the "input" slot)?
Using the inventory you can set the input slot item
Is It possible to create spheres using block displays?
does someone know how to apply force towards a player? for example shoving them away from a position
if you meant how to get the vector that would be the opposite of a specific position, just get the delta difference of the player's location and the position you want him to get away from relative to the position.
how do i save defaults of custom config?
why tf does bukkit decide to do this?
figured it out
its supposed to be <= not <
Yes Laby
why not
would’ve probably been more efficient to use Vektors but
this works
cuz its only accurate for the min values
should be <=
had to make my own method to fix that issue 😦
well
it works
but if u want a better solution use vectors
they almost double in speed i tried
you should have read the docs?... it already mentions it there
btw what class is that anyways
BoundingBox
https://paste.md-5.net/aqahiwajor.java here it is with vectors
ah you use cords
well same thing
Guys does someone know how to send explosion packet on latest spigot using packets?
Not nms
I dont think you can send packets with spigot, do you mean particle?
Hi im trying to learn pdc.
Im using this https://github.com/mfnalex/MorePersistentDataTypes
to store ItemStack and more in pdc without to have to encode my itemstack to base64 etc.
My question is about namespaceKey. If i have an item with a level, a player owner, a storage of item (list<ItemStack) do i need to register one namespacekey for each variable, so one namespacekey for my level, another one for the owner etc. Or just one namespacekey with a String as PersistentDataType
Yes one per
Ok thx, and is it good if i register all my namespacekey as a static variable in my main class of the plugin?
Yo does anyone know if gson saves strings with “ with a \ ?
Pretty sure you can yeah
Wait no you need plugin instance
private static MyPlugin instance;
public static NamespacedKey GENERATOR_NAMESPACE;
@Override
public void onEnable() {
instance = this;
GENERATOR_NAMESPACE = new NamespacedKey(this, "generator");
}
Yep like this ?
Yeah pretty sure thats fine
Ok so theres no reason to block quotes in commands where players are promted to enter a string?
thx 🙂
Nah pretty sure it sanitises it
Double check tho
Worse come to worse just encode it
get AUTOcorrected
nice xD postgre is nice indeed
Hi, i'm trying to send a packet to server (bungeecord)
to connect to a specific server
my console
minecraft-protocol writing packet play.custom_payload +14s
minecraft-protocol {
minecraft-protocol channel: 'BungeeCord',
minecraft-protocol data: <Buffer 43 6f 6e 6e 65 63 74 00 38 31 37 36 32 33 38 32 2d 62 32 30 35 2d 34 36 65 65 2d 38 33 33 64 2d 34 66 62 65 35 66 39 62 35 31 34 64>
what do you want to achieve? what have you tried? what is not working? what is your problem?
Basically, I want to make a bot that connects to a faction server.
When it connects to the server, it's on a lobby.
The /server command is disabled.
So I try to send a packet to the bungee so that it connects me
my code :
client.write('custom_payload', {
channel: 'BungeeCord',
data: new Buffer(['Connect', '81762382-b205-46ee-833d-4fbe5f9b514d'].join('\0'))
})
The problem is that the bot doesn't connect
You cant do what you are trying to do. The connect packet is sent by the mc server towards the player and intercepted by bungeecord.
Packets sent by the client towards the server on this channel are useless.
But what about the (normal) client?
Because to connect to the faction server, you go through a (custom) GUI and click on a button to connect to the server.
- Client sends a button click to the server
- Server sends a connect packet to bungeecord
find out the slot id and then send the click container packet:
https://wiki.vg/Protocol#Click_Container
There is def some utility by prismarine for this
damn thats a sick gui
just send a inventory click packet with the slotid where the item is
its not that hard
but need to click on gui (after item click)
click item → open gui → click on gui → connect to fac
yeah or press "v" key
i didnt know there i an V keybind
and whats the problem with it its that simple xd
Yes, but how do I send the "I clicked on this faction server" packet?
it's modded server
use node-minecraft-protocol
But on gui there is no slot
.
it's modded server it's not a slot
are you 100% sure
if so you need to send the packet that the mod is sending
but if it has a custom packet for it you also need to impl that custom packet
but as its a gui it would likely be a inventory click packet as well
you could lookup the network
but you would need to decrypt everything
or you could debug it in you client
What mods or modpack?
deiobfuscate it
ur funny
100% rat
no
Its probably still a slot packet. Very rare that modders add a lot of protocol specifications.
as i said
If anything they use the custom payload packet (as they should, it is for custom payloads for mods to use)
but if it's a regular menu with funky fonts and offsets, then it's just common inventory stuff
but as its a kind of gui impl its probably just a custom gui iml with custom slot ids
check dm
custom mod? Not sure why a custom mod needs to be obfuscated, but its not impressive to say the least either
obfuscation never stopped anything nor does it prevent someone from reading anything either
because they a tryna hiding the rat
Their core mod is obfuscated but the GUI lib is not
The server is: Paladium
biggest pvp-fac french server
don't care about the server
I am probably one of few people here who don't care about MC servers
I never played on hypixel if that should tell you anything 😉
bro nobody plays on hypixel expect american people
it doesn't stop it, but it makes it very difficult
i would kill myself before playing bedwoars with 300ms ping
I can use a hexeditor to read java class files just fyi, your obfuscation only changes the class names, method names and variables, but it doesn't change how the program works, how java works or even change the bytecode
if they make a native obfucation and than also obfucate the natrive code or crypt it its very hard
doesn't change the bytecode
obfuscators normaly do change the bytecode
the most obfucators do change everything in the bytecode
obfuscators do not add bytecode to java
when class look like this :
they do
some do
there are also obfucators that remove als java bytecode translate it to native code and runs everything natively
why would the JLS have any bytecode?
then I will believe the arbitrary introduction of unkown bytecode
JLS cares about the language, the VM about the bytecode
either way, point is, there is no introducing random bytecode that java doesn't know unless you running a custom JVM
also yobfuscator can use bytecode instructions that are not allowed in default compilers
but if you want to say there is, show me an example
but in jvm internals
otherwise I call BS
no-one said it's introducing bytes the JVM doesn't know about
you can just remove all bytecode and make everything native
you just have to change the bytecode in a way that it performs the same logic in the end
ok, so as long as you can't change the bytecode it can always be decompiled and it can always be read by anyone who knows how to read bytecode without decompiling
not really
if you replace string equality checks with hashcode of the string equality checks
but what do I know bytecode must be magic as much as X86 instruction sets are
you couldnt tell what string is checked
also as i just said you can use jvm internal instructions that nobody realy knows xd
but good news for me, as long as you keep believing your fantasies I continue to have a job charging as much as I want for security 😛
its documented
but ok
ARE YOU SURE!?!?!
yes, other then fact its open source as well
yes lol
show me the docs of all jvm internal instructions
What is this?
classes in jar file (core mod)
show me the part of the jvm internal only instructions please
i dont think they are documented
HAHAHA THERE IS
wells its open source, so even if there isn't like hard documentation you could just look at the code
you just downt know xd
there is no docs you need to know the src
there is docs
Anyways, continuing on, most of the JVM internals is instructions to native
?
there are no "internal" or "hidden" instructions
it's all publicly documented
shhhh, its secret
would be a shame if anyone had access to https://github.com/openjdk/jdk
lmao
its not documented here
what isn't?
that is not a bytecode instruction, that's a hotspot optimisation
hotspot, linked above, is also highly documented
no its also an bytecode instruction lmao
not
what's the opcode then
yes
shoulda known
i like if it people have no idea but telling me i have no clue
I think we do have one or another idea of what we're talking about
how to get input from sign in spigot 1.20
yes but all of you telling me i cant use FAST_INVOKEVFINAL in bytecode