#help-development
1 messages · Page 747 of 1
why shouldnt you be able to? if its separate for people make multiple instances, if they look at the same inventory open the same inventory for em all
Because the CustomInventory itself is already an instantiation of the CustomInventory Class
yeah thats what im doing anyway but just wanted to know how it's done there
When did what change
you added more generic
but generics are awesome
yeah but changes
what's a good way to implement an invites system for a factions plugin? Store the invites per faction mapping to a player or something?
Depends on how you gonna structure the usage of ur invites
Ok I guess it would work with like a for loop for each team
But presumably you prob want the invites encapsulated inside some faction object
i have a factions manager object
would that make more sense?
then perhaps i could map player UUID to a faction ID
You wouldn’t store the invites there tho lol
And manager is usually a bad name as I assume that class is just a glorified map, no?
Ugh i mean keep the “manager” although its more of a repository class
I just said that it makes sense to encapsulate the invites inside a faction object, you don’t agree?
there is a few different ways to do this, but it all depends how you are saving the info to begin with
hmm ok
how would you suggest checking if a player has an invite from a faction if they were invited but didnt accept, and then logged back in?
i was planning to notify them like a sort of mail thing
Faction#isInvitePending(player)
or sth like
Faction#getInvitationState(player)
You can make so the invitations are expiring after x time period subsequent to creation
yea i dont like gradle for some reason
Not gradles fault
mine? D:
You just haven’t specified what dependencies to shade etc
I mean yes?
ah you probably need to add a shade plugin (shadowJar)
Since I assume you’re developing against gradle’s normal java plugin
idk im using Minecraft Dev plugin for IntelliJ
That thing is like a tutorial island without any finish line, it has some niece QoL features but def lacks some stuff
thanks
(Then you run shadowJar instead of build (or jar))
And the output file should be named with the suffix -all
Nothing
you just change the task you run
You just run the task shadowJar instead
yeah, its pretty nice for being an external plugin you have to add
ye
Yes the issue iirc is that build would still run some other tasks redundantly even though shadowJar in theory should substitute all of jar
typically for logging purposes you shouldn't use color codes as these codes will show up in the log file and make it harder to read or find the info you are looking for. So it looks good when you have the console up, but that is it.
most people who run servers are not even looking at the console, and even if they were the console has a limited history you could scroll back to
how do i store entire objects on mongodb or is that not advisable
actually scratch that i dont think i installed it correctly
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
trying to install it using this page but idk what to do with the jar with gradle
you would shade it in
reason you don't shade in the connector for mysql is because spigot already has it shaded in
but spigot doesn't shade in connectors for all DB's mongoDB being one of them
Why all spigot tutos explain mongodb against MongoCursor instead of bson document?
the command stuff in my current plugin is so jank but its the best way i can think at the moment
oh nice, how does your command structure work
basically uses the arg command handler in my lib to create the start command, then it janks into another handler with another impl of that to work with it only have args that it will need
yeah
So far thought them as Single and Parent structure, where Single represent a command with none implicit arguments. While Parent, has implicit arguments or other parents associated to it. What do you think about it?
the names could probably do with some work but the idea works
right i having some nightmare around recursition
Specially with parent, because one parent have more parents associated to it and that into an infinite chain. Which ends in recursive execution
the way mine works is there an abstract simple command handler, takes a permission and overides tab complete to return an empty list, then my arg command handler allows you to create sub commands, but its desinged so you can stack it as it extends simple command handler
yeah mines is similars to you
yours Arg command is mine Parent, same with simple command is my Single
i will have to code it carefully hehe
How can I make it always the latest version, whenever I create a new project it starts with 7.3.3
file>settings>Editor>File and Code Templates>Other>Minecraft>Common>MinecraftDev gradle-wrapper.properties
yo
question
this ShadowJar stuff
puts all dependencies on the Jar right?
the ones that should be shaded yes
All the ones you tell it to
shouldnt you be asleep
It's 8pm
how should i tell the plugin which to shadow
use implementation over compileOnly
like this its ok ig
Don't shade spigot 💀
k
kek
like this?
ye
cuz im trying to obfuscate
but the obfuscator cant think for itself so i gotta put all dependencies in jar either dependencies for the obfuscator
and stuff
BUT IM NOT EVEN USING LOG4J BRO
shouldn't bother with obfuscating
When obfuscating, you must tell the obfuscator what libraries you used. So it doesnt obfuscate them
a
Spigot does
i know but if im new to this i gotta start learning and stuff
I told him first time when he ask for obscuators recommendation. But who want to obf will try everything
yes
Your code isn't special enough to be obfuscate
never backdown never giveup 💪
But he will realize he will just lost time
i know im losing my time
most ive done in the past 3 weeks
@river oracle it is a canonical event, we can not intervene
NEVER BACKDOWN NEVER WHAT
free version what more you can expect
k
Premium doesnt even take more than 1m to answer longer question
What do you want to obf i can do it for you if yo uwant
thats like paying for skins in fortnite ☠️
ur paying in a free game
nah
dont wanna bother u
no bruh, thats not how it works
i dont know what you wondering to say, but all same shit about premium things until they give a try
well
Is that same that saying that Copilot is like paying air when thats is totally fake. Its even more powerfull than any other AI rounding
thats kinda true
@river oracle opinion on reload confirm
i dont pay copilot
its given free for students
👲
Why
while I don't disagree with learning, what exactly are you looking for obfuscation to teach you?
wondering
idk
obfuscation doesn't stop anyone. MC is a prime example
In what context
how can people be so unoccupied to reverse engineer a 2usd plugin
MC used obfuscation, and yet we still managed to do what we wanted with it
development
mc was obfuscated?
still is
Oh thats a gentle man, not many explains about obfuscation. They just keep that knowledge for them like if its gold when is totally the oppsite
It's fine as long as it doesn't break your plugin
there is no knowledge to obtain from it
well i was talking that with @sterile token
if people want the code, they'll get it
but they'll need to know how to do it
feck sake
?
like, i dont want to gift it
i making something that relies on worldedit percents, and its annoying bc it uses weighted random
obfuscating it or not is the same as gifthing it
You're code is not special it's nothing revolutionary stop obfuscation especially for plugins of open source software is pathetic
The reason obfuscation can be defeated is learning java and the JVM. If you learn those two things you would understand why obfuscation is pointless with the exception of minimizing sizes I guess, but size isn't an issue when your project isn't even going to take up a tenth of space of HDD's
Everything that is understood by a machine is understood by a human.
Its not that, Java was never designed with protecting code
Not necessarily true ai is a perfect example
lemme be happy
@worldly ingot i blame you
Obfuscation won't provide happiness
because Java was more geared towards the Enterprise side and in the Enterprise side its actually far easier to control businesses in what they can and can't use without using obfuscation
so it wasn't seen as a necessity to incorporate such things
Sure change the name of methods and classes, doesn't stop me from naming them myself
You are going to laugh too much but I have read bytecode of obfuscated plugins and it was just a waste of time, because it is garbage programmed code. Here is an example, where why obfuscate if the code is no big deal.
as long as you have a decent IDE you can see where all methods are used and variables
did you ever look at the metadata?
yes
then you would know there is no hiding anything
Well it is, and with very little to gain from it
this is why like 99% of java projects do not bother with it
not difficult, wasting of time, thats the correct term
use a restAPI
its not what i would like
what u mean
what you trying to do??
you want to add a DRM? If not doesnt make sense that question
look
I forget the kind of credential system, but anyways you validate through a restAPI with a different set of credentials. And the restAPI is the one that keeps hold and secures the aws credentials without exposing them
IAM
but to access iam
u need 2 keys
access
and secret
the ones like lined
is aws for storing data from the plugin, or is it saving stat data for the plugin
its just a simple License manager
rest api
just remove it
people can crack anyways
people do anything to get free stuff
yeah they can crack it even more easier than if you obfusate it
its not overly difficult to decompile, remove your license thingy and recompile
it sends/asks for the data the rest api responds with what it needs, to check just ask for xyz rest api verifies then queires aws
yeah exactly that
He did a simple DRM
whats drm
but now, if you use something like a RestAPI you wouldn't necessarily stop them from using the plugin
but you can stop them from accessing the data
it is a technology and set of access control techniques used by content creators, publishers, and distributors to protect digital media
idk why people care so much about people cracking their plugin, oh no they want to use ur plugin
well
i used to crack plugins
yeah lmao, and then you see the code and is trash. said it by personal xp HAHA
just know not even native applications are safe from cracking either 😉
if i ever do decide to sell premium im just gonna publish it free on github with source code bc if they want to use my plugin i would rather it have no malware from cracked sites
you can even reverse engeenier native apps so dont lost time
Now here is the thing though
if you have to combat people from taking your plugin, you are going about it the wrong way to deal with it
that is, you are not actually addressing the problem
Yeah first thing you must do for selling, is licenses nothing more efficient than that
the problem may be your price is too high if you are seeing too many so call stealing it
maybe release a limited free version
but those who steal it though had no intention of paying, and those are not your customers, and if them stealing it isn't affecting your loyal customers you can largely ignore it. Adobe Photoshop became popular because it didn't really care people stole it
it was free advertisement to them
they knew you could crack it easily and they didn't put much effort into it beyond just needing a key but the thing is, someone had to buy the key first 😛
this is how Photoshop became popular and reason anyone knows it
but they knew it would get spread around and it would be all people talked about because friends would recommend it
Adobe was brilliant in this regard
Can falling blocks glow?
BUT STILL THE PROBLEM IS HOW DO I PROTECT MY AWS CREDENTIALS
I already told you. You are going to need a service like restAPI
or one way hash the credentials
hmm
but if its merely to pull a license, restAPI can do this easily
that should be in a server i bought right?
RestAPI basically revolves around endpoints to provide information. the RestAPI Server is the one that does the actual work to get the info you requested
however you will need to have some small server to host the end points
cuz i was also thinking of doing that instead of using DynamoDB
yea thats the problem
but aws does give free servers for 1 year
however there might be a better way
And well 1gb ram and 1 vcore should do for just some http get requests
why not sign user certificates instead?
what u mean
you can validate users to something via certs
i keep getting this error whenever i try to load my plugin
the thing that wants to validate provides the cert and then you can check against your cert if its valid
still need a small server but this is less intensive and you only need a HTTP server for this
like a really small one
talking about only need a couple hundred of megabytes XD
and virtually no HDD space
except to hold the http server really
its basically impossible to fake a 502 cert
you would need to get a hold of the signing cert in order to fake one
why is it all on 1 line
idk
does it showa s 1 line in logs?
going to search abt it thanks
do you have a plugin.yml or a paper-plugin.yml
it won't stop the stealing, but this just helps you validate your users in a more efficient way
yes
stop stealing is imposible
I still crack FL Studio 😻
lol
somehow i dont think yes is an answer to an or question
plugin.yml
?paste plugin.yml, ur main class and EventToggling if its not ur main class
how do I add MongoDB to my project with gradle?
remove this
ok
why the hell do you not use monospace font wtf
why does everyone hate it
Wtf is this
it's literally hideous
because it's weird!
Jesus

💀
i love how i awoke everyone by screenshotting pastebin
thanks, it worked
they appeared, said stuff, and left again
Yeah because it was awful
what husky cani have
is .forEach just for (Player p : Bukkit.getOnlinePlayers())
?
getOnlinePlayers() returns a Collection<Player>, it doesnt return a list of locations
If that what u meaning
haha
me too
imagine im having a compilation error which isnt maked by IDE
hahah
Some time IJ doesnt make sense when giving errors
Why does adding an item to an inventory that belongs to a chest blockstate and then updating the blockstate not add the item to the chest in the world?
How can I do something like that?
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
i assume you're saying that, no, normally that does not happen?
It depends how you are trying to do it
but we be guessing in what you are or not doing without something to look at
there is api methods to update the state of a block and methods to feed data to create said state
BlockState preState = event.getBlockPlaced().getState();
Chest thisChest = (Chest) preState;
thisChest.getBlockInventory().addItem(item);
thisChest.update(true, false);
does not add the item, for example
well it says string can't be converted to a string array
yeah that why doesnt make sense 🤔
Ur saying it can?
what?
String can be converted to string array?
Im just said that the issue doesnt make sense, because im never converting string into String[]
Must be an IJ compilation failure i will update the maen-compile-artifact in case its bug or broken
Some times java has many weird issues that you can realize
try use a String[] as the params
i would but who uses String[] for sending many texts? commonly is used List but will try tho
hmm
Even Config#getStringList() returns a List instead of String[]
Vectors are not used now a days they used to be used
for (Player p : Bukkit.getOnlinePlayers()) {
if (!p.hasPermission(permission)) return;
for (String str : text) {
p.sendMessage(text);
}
}
yeah i know, but must work with what i sent
?
If it would work the IDE must be putting a red flag over the code even before compiling, just during coding process
Uh which one is lime 46 and 51
String[] is valid to use, many methods use it, such as main method for example uses a string array for arguments
yeah they sucks too much hehe
why wont this work
but your issues is how you are doing foreach, its best when having issues with lambda's to break them down to see what is really going on
i mean its perfect, but i want to find what causing mines not. If its the same thing
this is the very problem I hate with lamdba's in where it hides details
what do you mean by that?
goofy ahh maven compiler
If the compile exception is what it must be - IDE should mark an issue even not compiling - isnt it?
yeah must be a maven compiler issue - there is no other logical explanation
Pls send screenshot with line numbers
Bukkit.getOnlinePlayers().stream().filter(p -> p.hasPermission(permission)).forEach(p -> Arrays.stream(text).forEach(p::sendMessage));
its not a maven compiler issue
try this
and it seems slokx is on the right path here
right, will try compiling with it
that exact same code is built fine by regular javac and gradle
so there is something else maven is messing with here
maybe it’s language level or sdk
okay def was that. I updated to latest maven compiler and compile now
which code
💀
mine or urs
😄
all of them
Maven has extrange bugs haha
You should nevertruth of its issue
Interesting, I'll keep that in mind
But thanks to all for trying to help
well it depends which java versions too, since sometimes implementation does change
tried with 8 and 18, was the same issue
that isn't what I meant
I meant maven compiler versions are sometimes specific to a java version or a range
oh you mean the language level right?
oh okay i understood what you meant
also just fyi, you can with maven specify a specific compiler
you don't have to use the maven compiler
but yeah sometimes the problem you are encountering isn't always related to the compiler, and its just due to the combination of lambda's put together
either way now its fixed and you can proceed onwards 🙂
yeah, thanks to all
I created some Shapeless Recipes and registered them to the server, I also discovered them for all players, but while the recipes work when manually crafting them, they do not show up in the Crafting Menu unless I select all recipes. The recipe output is enchanted and the ingrediants have lore
I would help but recipes is one of the few things I don't really mess with 😦
hopefully someone can help with your problem lol
🤣
got a lot of open space there
ignore that file
Thats not pastebin
Incorrect jar i guess
?paste
Please use pastes
This occasionally just happens
Should be fixed after a fresh recompile
whp are you
whys this happening?
Is it better to save block data in text format or in key format. Which object is best suited for the player to save the placed block?
in file
Can I somehow set the permission-message in my onEnable for each command instead of having to run getCommand() every single time?
what?
What is a key format?
PluginDescriptionFile descriptionFile = getDescription();
for(String commandName : descriptionFile.getCommands().keySet()) {
getCommand(commandName).setPermissionMessage("Some message");
}
But in your onEnable you need to use getCommand(...) for every command anyways because you need
to reguister an executor for them... So whats the point?
String permMessage = "You are a bob and cant use this";
PluginCommand someCommand = getCommand("some");
someCommand.setExecutor(new SomeExecutor());
someCommand.setPermissionMessage(permMessage);
PluginCommand someOtherCommand = getCommand("someother");
someOtherCommand.setExecutor(new SomeOtherExecutor());
someOtherCommand.setPermissionMessage(permMessage);
standard yml format
I would use the String format for BlockData. Its easy to save and deserialize.
You cant serialize a BlockState
oh
I mean you can, but its a hustle. And you need the BlockData anyways.
what will be if i will use 1 data file for save for all blocks placed by all players
or better use several files?
u can def use 1 file, depends what you need that data for
That sounds like a data nightmare. Use one file per chunk.
again, depends what you need it for. There's a plugin that tracks what players do, so that's stored in one large database. but if you just want to know which blocks have been generated naturally and which havent, you can just use the chunk PDC to store a bunch of booleans (though I'd recommend bit packing here)
I used setTarget on a skeleton to target a ravager when i hit the ravager. But the skeleton still aims for player. Is there something else to add?
Perfect (both variations), thank you
ykw, before i refactor my shit, can I use colors in these?
Try listening for the EntityTargetEvent and make sure the skeleton doesnt switch back.
In the BlockGrowEvent, what is the difference between event.getBlock() and event.getNewState()? Does the event.getBlock() sticks in the old state?
What does the javadoc say?
Javadoc is unclear
What does it say?
Gets the state of the block where it will form or spread to.
getNewState()
And the other?
Gets the block involved in this event.
getBlock()
getBlock() is the origin of the event and getNewState() is the target state (which involves the position).
I assume getBlock() will return the origin Block which is still in the original state.
You can get a String representation of it that can be deserialized with the Bukkit class
BlockData not serizible
not impl serizible intarface
oh
so stream classes not need??
bukkitStream
ByteStream
etc
oh
lol
Is there any way to have a view of list on top of collection (not a copy), i dont care about ordering at all, i just want to forcefully put collection where list is expected (it wouldnt break the implementation, its just an artificial constraint to put list there, because it copies to its internal list afterwards you put it anyways)
I mean list is a collection already. Try to explain a bit more.
Who expects a list? If its your own method then you can probably rewrite the method to take a collection instead.
bukkit command api .setAliases() expects a list, but it doesnt make any sense, since the aliases aren't ordered in any way
my wrapper returns Collection<String> for aliases instead of List<String>
so i cant plug it into command.setAliases()
Either make your api return a list or use a quick wrap using List.copyOf(yourCollection)
are the people that approve plugin resources in this discord? i need to tell them they did a bad job in one of my last attempts to be approved after one week!
i can just do new ArrayList<>(collection) but in that case i would create a copy, that would be fine, but internally .setAliases() copy the elements in the same fashion
so im cloning the collection twice
which isnt really great tbh
Its not like you create aliases every tick. Its just called once and then its done. 50 micros more or less doesnt matter.
But i see how it is a bit annoying
i give up, i will change my return type according to the bukkit api constraints :/
neither java collections, neither fastutil have an adapter of list interface for collection
Because its kinda impossible unless you throw an UnsupportedOperationException in almost every method
its possible it would just break the rule of the list that every element's order is deterministic
what going on
?paste
https://paste.md-5.net/tuwosodira.java is this enough?
This will cause problems for many cases. Index access is really important if someone wants to
do an index iteration.
myeah ok
Btw, is the permissionMessage automatically sent, upon the player missing the permission set in the plugin.yml?
(oops, sorry for pinging)
What is better using == for checking enum value or .equals?
Google says == is best practice
iirc == compares instances, .equals(...) compares object values, not sure how that helps but ¯_(ツ)_/¯
and what is the difference between them
Doesnt matter. Enum impl internally just uses == for .equals anyways. So == spares you one method call.
ok thanks
.equals is used on strings, because if you have two different String instances they're not the same since they're different objects, but their values might be the same
== checks if the objects have exactly the same memory address (meaning they are exactly the same object)
.equals() checks if two objects "look" equal in terms of their internal structure, even when they are not
exactly the same object.
just dont use == for non primitive data values
What about checking if objects are null?
== null?
Yeah
But i also heard about Objects.equals(obj, null)
yeah I also heard about that but actually never use this
^?
yes
Perfect. This just made my code a whole lot cleaner lmao
permissionMessage does not work for me smh
Objects.equals(obj, null) is practically useless, its used when there's two object references which might be one or two of them null Objects.equals(foo, bar), so it checks the null cases before doing .equals() operation
Oh so just use obj == null i‘m guessing?
if you dont have another reference, just use the way you wrote it rn
how can i make that crystals make normal damadge like in cpvp?
What is abnormal damage to you?
Funny thing is a couple days ago i finished a massive refactor of my code (it was all kamehameha arrows) which also included changing obj == null. to Objects.equals(obj, null) lmao
Im guessing that they implemented a custom explosion with knockback and damage
okay
thats meaningless
obj == null implies Objects.equals(obj, null)
When you compare something to null it's basically checking if that object is defined, exists or whatever
Hi, how would I get an advancement out of the PacketType.Play.Server.ADVANCEMENTS in Protocol Lib? Can I get it as a json or smth like that?
It's basically just like telling your friend to bring something if he has it, then when you meet you ask him if he does have it
Hi, can i ask ?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
how do i fix mysql problem like ‘The last packet successfully received from the server was 55,058,023 milliseconds ago’
im using HikariCP
on my spigot plugin
the connection died
every time you send new package check if connection is up if not make a new one
thats the simplest way
Make sure to use your connections for only one execution and then close them again.
Always get a new one.
3 hours so this happen
oh ok
With Hikaricp you should close the connection after you use it
Thats what HikariCP is for
okay thanks
yh sorry i overread the hikari part
is the minecraft server inheritly single or multithreaded?
if we dont consider BukkitRunnables etc
BukkitRunnables are tasks executed in the main thread
so theres only 1 main thread and one for networking and one for chat?
No
There’s a main thread, a chat thread, several networking threads, several worker threads, several craftbukkit worker threads, and a watchdog thread
bukkitrunnables are executed on server thread if you don't use the asynchronous variants where they would be executed in a cached thread pool instead
all bukkitrunnables are however ticked on the server thread
^
what coll said also, (might b noteworthy to mention that the actual logic processing usually happens on the main/server thread, that is all the ticking, most physics etc)
Yes
The worker threads are pretty much only used in worldgen
Chat thread is for chat
The networking threads are for packet sending and receiving
And the watchdog thread makes sure the server is still responding
yeah, I mean it makes sense, its hard to split up the actual logic to different threads (altho folia does it, it def comes at a cost)
like when a player join so it use mysql data and after that so i would do close connection right ?
or update mysql data
like that
Sure. Just make sure to never use the main thread for IO like Databases.
Every event runs on the main thread and blocks the mc server unless there is "async" in the event name.
For loading player data, use the AsyncPlayerPreLoginEvent and for saving use the PlayerQuitEvent but start
a new thread or use an async bukkit task.
okay thanks
Is there maybe a ProtocolLib Discord I couldnt find any online?
itsss fine if it happens during startup, else yeah
Do you guys prefer ORM's like JPA/jakarta (hibernate for example) for database management, or do you handle JDBC operations manually with DAO's?
its more to put in into an orm, then what you get out of it
esp if u solo a project
it can be nice for group projects
i 100% agree
i've used hibernate with spring before, hell it is bad when you want to optimize something
for me personally no matter how i setup my annotations to do lazy loading, it will always send inefficient queries
like instead of returning a all columns in one query
it will spam query requests for each column
its pain in the ass
yeah
sometimes
and if you wanna optimize it accordingly to your needs you'd need to invest time in understanding the implementation of said orm
which I mean, thats just a lot of work
now still, that might be better than to have 10 different devs with 10 different opinions on how the data modelling should be structured
lol
so this is my package structure for the project, would this be the right shadedPattern value? trying to set up bstats ```
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>at.evipez.craftingtableplus</shadedPattern>
</relocation>
pls
do it like at.evipez.craftingtableplus.shaded.bstats
to avoid conflicts
but I don't have a package named shaded.bstats
and if so, what would I put into it
You cant call getPlayer()
so I just create the package shaded.bstats and use <shadedPattern>at.evipez.craftingtableplus.shaded.bstats</shadedPattern>?
dont create no package
You don’t even need to create it
maven will do that for u
nope
idk what exactly u're doing
but based on the previous error UserConnectEvent is happening on AsyncPlayerPreLoginEvent
you cant call getPlayer nope, i cant??
which means, there is no player object present
People before docs were invented
a, i want User by player
there is no player to begin with
java.lang.IllegalArgumentException: name cannot be null
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.getPlayer(CraftServer.java:575) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3864-Spigot-d2eba2c-00f5a80]
at org.bukkit.Bukkit.getPlayer(Bukkit.java:611) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at dev.scienziato1pazzo.it.infiniteanticheat.player.IACPlayer.<init>(IACPlayer.java:32) ~[?:?]
at dev.scienziato1pazzo.it.infiniteanticheat.player.events.PlayerJoinEvent.onUserConnect(PlayerJoinEvent.java:23) ~[?:?]
not in that event
You are trying to call Bukkit.getPlayer with a null name
oh nvm
I updated the shadedPatttern and built with maven but no package was created
i know, but i dont wont Player but User by Player.
did u pick the right jar?
then add that feature
you'd need to have some sort of injective Map<Player/UUID,User>
Is there a way to get the user from the player?
its your code right?
no
how is it not ur code when
at dev.scienziato1pazzo.it.infiniteanticheat.player.IACPlayer.<init>(IACPlayer.java:32) ~[?:?]
at dev.scienziato1pazzo.it.infiniteanticheat.player.events.PlayerJoinEvent.onUserConnect(PlayerJoinEvent.java:23) ~[?:?]
yes but User is not my
You want to get an IACPlayer by a User?
no, From a "Player player" to a "User user"
i have find it
it go?
idk, I think this is a question you should ask in the packetevents discord to begin with
ok
Logging
what do you mean
Is there a way of displaying a different string when doing return false in a command and when executing /help <command>?
If not, I fucked up
Lmao
i think you are fucked up
let me do some research
Would be lovely
change the usage message in plugin.yml or send your own usage message and return true
Yeah i‘ve had that with my own usage message and returning true + providing a usage in the plugin.yml to display it in the /help menu
Now i changed it by setting the usage onEnable for each command as usage and returning false
Wanted to clean up code
Then I just executed /help <command> and saw the message instead of the usage :(
I think the most common approach is to just yield true and dump messages to the sender inside onCommand
F*ck
All that refactoring here and there took me like 4 hours maybe more. All down the drain now :|
once upon a long time far far away in another galaxy, bukkit created a command api amongst the many living dinosaurs that once roamed the earth, it was at this moment that the initial command api contructed didnt take many aspects into consideration and so we got a simple quadpredicate, but I mean, the dinosaurs didnt really have any needs for complex command building etc like today's brigadier etc
Tbh what bukkit COULD implement is:
command.getUsage(String prefix) (as extra method overloading the original)
Which just returns prefix + usageMessage
The one without prefix is called on /help
bukkit could do many things
The one with is called upon onCommand returning false
That would be like 5 minutes max
Is there a way to submit tickets? Lmao
I mean thats 5 min max for u as well
PR it then
prefix + command.getUsage()
for u
lol
they typically dont want these kinds of utility functions anyway
Tbh fuck, u right
CLA is rather annoying though
CLA?
for PRing
Not really only md5 sees it
i understand it legally
but still would rather not
Unless you're worried md5 is some stalker (he is)
What‘s CLA?
?cla
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Ohh
I mean, I still have to undo everything I did buuuuut that‘s better than what i‘ve had
i havent touched the command api for too long, but i used to just do sth like
@FunctionalInterface interface VoidCommandExecutor extends CommandExecutor {
void executeCommand(CommandSender sender, Command command, String label, String[] arguments);
@Override default boolean onCommand(CommandSender sender, Command command, String label, String[] arguments){
this.executeCommand(sender,command,label,arguments);
return true;
}
public static VoidCommandExecutor of(CommandExecutor executor) {
return executor instanceof VoidCommandExecutor voidExecutor ? voidExecutor : executor::onCommand;
}
}```
I'm sorry you put your annotations on the same line as your modifiers?
We can't be friends
i had to make intellij stop doing that
lmao, that's... the way it should be! :)
is this a weird eclipse thing or is my crappy external drive failing
anotations go ontheline above smh
Was a lot faster than I expected. Gotta love regex
I can confirm
he doxxed me once
\j
Omg how could he have known??
Yeah same, i think it‘s just to be ignored. If there‘s a fix to those warnings tho, please ping me lol
why tf does intellij cream about using normal comparison operator
when im implementing equals
btw is there any java way to create a case insensitive string
Case insensitive how
You could just lowercase everything passed to it
currently im using fast util's custom set
Or make use of equalsIgnoreCase
that would require me to for loop it
before adding to set
?
i need to add the collection
not one instance
basically addAll(Collection<String>)
im wondering is this the best way
that allows me to supply custom hashing strategies
like i've shown in the screenshot
How would I go about getting the max damage of an item?
Or alternatively is there a better way to go about dealing damage to an item than damageable.setDamage(damageable.getDamage() + 1);
Material has a max damage method
Gotcha, thanks
Any ideas what event is ran when a player attempts to place bonemeal?
Interact
Hmm thought so
I mean, what rest api
depends a lot on the usecase
but also, what language you are comfortable in
How to copy a world and create another one? I tried something like this but idk if it worked, pls tell me if im wrong:
WorldCreator worldCreator = new WorldCreator(nameOfTheNewWorld);
worldCreator.copy(arena.getWorld());
this.world = plugin.getServer().createWorld(worldCreator);```
the thing is that the original one is a flat world, but the generated one is a normal world
this saved me
void createNewWorld(World world){
File worldDir = world.getWorldFolder();
String newName = world.getName() + "_temp";
FileUtils.copyDirectory(worldDir, new File(worldDir.getParent(), newName));
WorldCreator creator = newWorldCrator(newName);
World newWorld = Bukkit.createWorld(creator);
}
Wcreator should have params
For world generation
I added custommodeldata to the custom block in my source package, how can I turn off particle effects by specifying this??
with data packs or in model.json
Hi, Should i use protocolLib with spigot api or nms?
from Plugin -> RestAPI -> DynamoDB with Licenses
smth like that
and well
i was reading from IBM
and it doesnt need a specific language, just a standard to do it
and i was thinking NodeJS to learn smth new
shouldnt be that difficult
I mean yea
if you are gonna setup a separate service that your plugin runs https calls again
nodejs surely works
Nodejs is legacy 😀😀
average bun enjoyer
its just a plain http server ¯_(ツ)_/¯
google bard told me to do it with C lang
lemme see bun
i thought the same
I mean, you can also do kotlin if you want
java also has some great HTTP frameworks (quarkus, spring, etc)
Just not worth it
ktor for kotlin does its job
i could do it with anything im some way
Yea
but i wanna learn something new
Welp, pick whatever language you are most interested in learning then
sure im doing 48k requests per second
thanks for the help buddy
Lua

rust or go maybe
I use lua as embedding
damn rust also good
yeah, or maybe haskell :D
that shi fast asf
mye
nah im doing it with CoffeeScript
goofy
rust 
shut up
imma throw some rewritten core utils at you emily
i'm rewriting coreutils in clojure
jython
Thats worse
wtf is jython
Python 2.old*
💀💀
cuz its easier
blud wanna make a server in the server
and people dont wanna learn new things
☠️
People dont like change
or its doesnt?
Python scripting sounds way better than skript
people doesnt like change or people dont like change
ok, bukkit command api is weird, i've managed to register command which is not in lowercase, tabcompletion detect it as normal, but handler just gives up 😄 im not sure if that's brigadier or bukkit command api which doesnt like this
its dont
it shows as unknown command, but tabcompletion works
thanks
people is plural
how tf ur command is in Uppercase
reflection hacking
worth it
i wanted to make case sensitive completions, but i guess bukkit doesnt like it
it works with arguments, but not with commands themselves
sounds very cursed
it is
i've spent like 3-4 hours
trying to setup this mess
only to be slashed by the buggy bukkit impl :/
so bored then
Hello, what implements i need to put in my class to get the command with tab-complete method ?
I mean it would be a lot of combinations/permutations that’d show up in chat no?
TabCompleter and CommandExecutor
thanks
thanks a lot guys
i think i found a bug that you can even guys replicate even if you dont have reflections to have the UPPERCASE completion for commands
according to what i see, aliases are not checked for case sensitivity
so they might invoke the same behaviour that i've sent earlier
for some reason only command.getName() gets turned to lowercase, but not its aliases, they're straight pumped into command map
and that's probably why it bugs out, since handler probably expects all commands to be lowercase, and doesnt check the command itself using equalsIgnoreCase(), but with equals(), thus "Unknown Command" pops up
wait, i've managed it to make it work
wtf
oh no which one is real 😨
can't wait for Banip2, bANIP2, baNIP2, banIP2, baniP2, banip2...
case insensitive commands
nah i just want to have completions the same way i've provided
without lowercasing it
but execution be lowercase
ikr
i've constructed my command framework around the lambdas
they're pretty useful
it works, but with one exception, if the PluginCommand's name is lowercase, if not it just rejects the command once again
Can I change what items a block drops?
int a = 1_000
isnt it unnamed vars
its used as a delimiter between numbers
I need some sort of help with my command api help part. Because im complicated about recursivity which i need to use caused because a command executor can contain more commands or execturos associated to it, like an infinity chain. By my goal is the enxt:
-
If you run the root command with none arguments (for example /faction), will give you the all the arguments and sub commands associated to it.
-
If you run any sub command associated to faction, with none arguments will give you the sub command help.
Im just struggling too much and having an innecesary nightmare
int a = 1_000_000
you can have number separator like this and it will compile
kinda useless java syntax feature
Yes
and i dont know why it exists
for(String key : section.getKeys(false)){
returns a size-0 keyset for this section from the config after calling config.getSection("limit"). Why?
the section clearly exists or it would be null
does it exist on the server
I dont think thats a section
it is a section
sections looks like:
Section:
key: value
key: value
there isnt a minimum required
no, because I'm not saving it so i dont have to go in there and delete the config every time i make changes to the section. I'm reading it like this
private FileConfiguration config;
public ConfigHandler(JavaPlugin plugin){
config = plugin.getConfig();
}
yes
sout plugin.getConfig().getValues()
no i said sout as short hand
Section are maps
What you provide in ur template code is not a Map
what template code
if gonna say you call section#set then dont save so the value exists in memory but not on the server
bleh where's my config gone to bruh
john spigot
delete the config file and restart
theres no saved config file
or, hardcode the config
see here
theres the issue
and then see if it there
Well, the contents of the file
not code resource folder
if you wanna have the config come from resources you need to call getResource and give the input stream to file config or yaml config
but thats what the issue here was
or just save the config
you call JavaPlugin#getResource and use the input stream
FileConfig is abstract and YAML config doesnt take an arg lol
YamlConfiguration config = YamlConfiguration.loadConfiguration(new InputStreamReader(plugin.getResource("config.yml"))
kek
different topic
what's the debug mod called
the thing that makes your client not disconnect if u debug
theres some things you dont disconnect for, the reason you may disconnect is watchdog
idk if any mods exist to make you not disconnect
@eternal night does kenny have one, would be something kenny made
I mean, just disable watchdog and send keepalive yourself
I have a snippet on gist somewhere
how do you expect to send a keep alive while the server is paused