#help-development
1 messages · Page 71 of 1
so if im not wrong:
- neural networks whose outputs cannot determine the success of the neural network, but the end result does, needs a Time delayed neural network e.g: for rock paper scissors
public class SpawnRelocation implements Listener {
@EventHandler
private void onPlayerJoinEvent(PlayerJoinEvent e) {
}
@EventHandler
private void onPlayerChangedWorldEvent(PlayerChangedWorldEvent e) {
}
I kinda want ai tho so this doesn't work for me
???????
It changes my nbt
use ```
it shows as normal wither to me
you could tick the wither yourself
dont use a summon command
this is a NoAI wither
it needs the spawning animation
Why use nbt api? Pdc exists now
Would pdc work for what I want? Changing entity size?
My tag plugin is depend on nbt api
no
PDC cannot access vanilla NBT tags
Ah
PDC can only access values inside the "BukkitValues" or "PublicBukkitValues" NBT tag
I see
Not talking about that
If I use pdc will my tags work and also won't change my crate key nbt on restart?
But my crate key doesn't work after restart
I'm using golden crates
What others? I can't find an entity it works for apart phantom? Slime and MagmaCube
yeah that's all I found too
Aight ill keep looking, I've known for a long time about slimes and magma cubes as they're slime mobs with diff sizes but phantom is interesting
I think phantoms vary the tiniest bit in size
Hard to tell when they are barreling at you
Ah I see, I wouldn't know, I've never played survival before nor beat the game
Funny how most plugin devs dont even play the game
so if im not wrong:
- neural networks whose outputs cannot determine the success of the neural network, but the end result does, needs a Time delayed neural network e.g: for rock paper scissors and tic tac toe
since the input will be the last player's game input, and the output will be the AI's choice, but how would it learn?
i also dont know whats a time delayed neural network i just heard it from someone
I guess it would have to keep track of the opponents last choice and try and find an algorithm
Tic tac toe would be pretty hard I fee
thats not what i asked for
L
im saying, how would it train
meaning, how would it know if what the AI did is bad
or good
you tell it
i need it to know that the move it did
resulted in a loss
wait cant i just do smth like dis
if (game lost) {
nn.train(game player's choice, good choice that would result in win)
}
Can someone tell me how to open a written book in front of the player in 1.12.2 ?
Is there a good plugin for generating a template for a minecraft plugin with Kotlin?
An IntelliJ plugin
idk
Just dont use Kotlin
You can use it if you really want but you'll have;
0 documentation relating to spigot (you'll have to convert all java code)
No way to efficiently make new projects
Every spigot dev will hate u as we all use java
There is no reason to as Java is amazing
No support here
u sure?
giant phantoms exist 💀
Have you tried [0x1, 0x2] ?
How can I get the permission node for any command of any plugin?
I was thinking of using the CommandMap but then I realised than not all developers assign a permission to each command
And that doesn't include subcommands (to my knowledge)
There is no reliable way
Luckperms does it pretty well, I checked their api and I couldn't find an implementation of it though
luckperms simply gets all registered permissions, it doesn't map them to any commands/subcommands, does it?
well it worked on my plugins and I didn't register any permissions
so some wizardry is going on
I think Luckperms listens for permission node queries and maps them
but that still raises the question of. 1. How do I implement that or 2. How can I recreate that?
check out the me.lucko.luckperms.bukkit.inject package inside the bukkit module
especially the PermissibleInjector class
it basically replaces a player's PermissibleBase with the luckperms one
hmm
do you want to write your own permission plugin, or what do you need this for?
Its really dumb, I want to override the tab completor to exclude all commands that a player doesn't have permission to use
Then just register your command permissions properly
its not for my plugins
Ah ok
some developers keep doing that shit and its so annoying
All of this seems like a lot for a simple task (getting a commands permission node)
But I guess the only way to do it is to listen for a query?
Is that why they override the default PermissibleBase?
0 documentation relating to spigot (you'll have to convert all java code)
No way to efficiently make new projects
Every spigot dev will hate u as we all use java
There is no reason to as Java is amazing
No support here
mfw 1) you don't need kotlin documentation because it's completely interop
2) new projects in Kotlin can just be done with a IDEA template or similar (I just do it myself each time)
3) bullshit, not every spigot dev is blind
4) not really
5) lol ok mate
Hello. I been making plugins for years for fun but I've noticed that I've always done them in the same way in the past like 5 years(the management of the Main class, instance, how to create the commands, like people use some super(...) class that I've never touched for example) and with this I've always came across several different ways and how everyone does it different than me.
I believe my way of doing plugins are for smaller/simpler plugins but I'm now doing a project that is huge plugins and I don't want it to be bad managed because of my start.
So I'm here to ask if anyone has some written or video tutorial explaining how to exactly do a well created base for a plugin to work smoothly and with examples for commands.
Thank you for your time. 🙏
anyone who knows kotlin, or any java dev who can decipher a method call which is incredibly similar to their own language can support here
it's not like kotlin is banned in help-development
🙏
you might want to use some framework to handle stuff like commands and avoid the boilerplate code you usually come across
I want to learn more about it tho, do you know of any tutorial explaining across it or thread on spigot explaining it?
uhh i dont know any specific threads or something but you might just want to google "spigot commandframeworks" or smth
Yeah and feel free to have a look at known plugins sources, you'll learn some new ways of programming
^^
That's where I noticed this different ways but I was looking for something explaining what each part does and what is needed, etc
the best way to start writing a solid plugin is by writing code and improving it, writing new code, etc..
it's been so many years so I thought there was some good tutorials out there explaining those frameworks
you could always make your own framework, that way you would have a proper understanding of how it works
That takes some time though
Kotlin devs recieve support here - however since most people do not know kotlin they may not be as good at finding issues.
why is this not sending aniything/playing sound
Thats what I mean
where to start from tho :kek: never done a framework
abstract your onCommand method away
If you've never played with interface and abstract stuff, have a look at it, there are bunch to do with these!
it will only send it to players not running the command (or whatever it is)
I was originally checking for it with
if (args.lenth == 0)
and only added the try catch not for testing if that fixes it but I'm still getting an ArrayIndexOutOfBoundsException
public class UpdateGamemode {
// public GameMode gameMode;
// public boolean requireClearInventory;
// public String[] commandArgs;
// public Player player;
// public Player target;
public UpdateGamemode(GameMode gameMode, boolean requireClearInventory, String[] args, Player player, Player target) {
try {
if (target == null) {
player.sendMessage(CC.RED + "That player is not online");
return;
}
if (player.getGameMode() == gameMode) {
player.sendMessage(CC.RED + "You are already in " + gameMode.toString().toLowerCase() + " mode!");
return;
}
if (requireClearInventory) {
if (!player.getInventory().isEmpty()) {
player.sendMessage(CC.RED + "Your inventory must be clear to enter" + gameMode.toString().toLowerCase() + " mode!");
return;
}
if (!target.getInventory().isEmpty()) {
player.sendMessage(CC.RED + target.getName() + "'s inventory is not empty so they can not be changed into" + gameMode.toString().toLowerCase() + "mode!");
return;
}
}
if (args.length == 1) {
target.setGameMode(gameMode);
target.sendMessage(CC.GREEN + "Your gamemode has been updated to " + target.getGameMode() + " by " + player.getName());
Bukkit.broadcast(Survival.STAFF_PREFIX + CC.GREEN + " " + target.getName() +
"'s gamemode has been set to " + gameMode.toString().toLowerCase()
+ " by " + player.getName(), "survival.staff");
return;
}
} catch (ArrayIndexOutOfBoundsException e) {
player.setGameMode(gameMode);
player.sendMessage(CC.GREEN + "Your gamemode has been set to " + player.getGameMode().toString().toLowerCase());
Bukkit.broadcast(Survival.STAFF_PREFIX + CC.GREEN + " " + player.getName() +
"has set their gamemode to " + gameMode.toString().toLowerCase(), "survival.staff");
}
}
} catch (ArrayIndexOutOfBoundsException e) {
?
lets just check the args length
i just, hate its bytecode
its
ourgh
?
Can you please show where you execute UpdateGamemode method? Btw catching exceptions instead of doing a check is awful
not as worse as catching nullpointers
noobpointer catching
I said in my message;
I was originally checking for it with
if (args.lenth == 0)
and only added the try catch not for testing if that fixes it but I'm still getting an ArrayIndexOutOfBoundsException
I dont see why you're making such a big deal out of something that isn't an issue
yeah ik
but my friend doesnt hear the sound
Yeah, but I mean I'm sure the exception is thrown before the updategamemode method
Are they close to you
no
That's the issue
if you UpdateGamemode(args[0],...) and your array is empty, even if you catch the exception in the updategamemode, you'll get the exception
You have to catch the exception before
it's because args[0] is called before the updategamemode
Here it is the code without the try catch that I only had for debuging;
which still give an error
I don't need the method, I need the area where you call the method
Well the constructor actually (strange)
public class GamemodeAdventureCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
new UpdateGamemode(GameMode.ADVENTURE, true, args, (Player) sender, Bukkit.getPlayerExact(args[0]));
return true;
}
}
:/
wtf
I dont see why lol @chrome beacon
?
So I should pass the code through a method and get the values in a constructor?
Few advice:
- move your UpdateGamemode constructor directly into the command method
- check the args length before all of that
- check the player exists
- sender is not always a player
i see a lot of weird things as _Rolyn stated, thats all
I appreciate the advice but;
I check if the target exists
I get sender is not always a player but its whatever if it gets sent from console, idc it's for me and me only
I do check args length first if u look at the code
Moving all that code would mean I have duplicate code in 4 classes for the same thing just different gamemodes
sqlite is weird bruh
You run args[0] before checking the length
don't lie to me ^^
throw away objects are not good
You're playing the sound at the your location
but i think its finally working
that thing has no reason to be an object
Your friend is too far away to hear it
make it a method
a constructor shouldnt be handling a command 👀
And if it's duplication then fine for not moving it, just use static method instead (cause you're creating objects
also why the CC.GREEN instead of ChatColor.GREEN?
Thats a question I had before that noone answered, thanks ill do that now and pass the vars with a constructor
Maybe custom RGB
pass them all to a method
Ok
creating an object just to directly throw it away again makes no sense
Why constructor
Why not directly to method
Forgot, typed without thinking
what about brain memory 🧠
check the length here, this is were you're calling args[0] before checking length
And when u checked there
and this is where the error should bring you actually

I think you had to actually check args == 1 in your updategamemode method.
Cause you'll have /gamemode <arg0: playername> [arg 1 optional: gamemode]
Thats annoying and bannable
Who tf is making all these reactions
there is no rule against it
There is
oh?
stop it
/ban 728562222162247760 3D emoji spam
Ah yes
/ban 583252968497872900 no
The undercover mod
I read through the rules where does it say no emoji spam as reactions? or in general
cafebabe doesnt know yet
not on every fking message lmao
Snitch
love how sqlite saves my uuid
Just don't and done
love how java turns characters into the weirdest unicodes ever
i fucked up and now i can remove my whole database 💀
its comparing strings with byte arrays pff
that took me two days
should i make a bot to make this happen?
no
all future and previous messages
it's trying to parse the bytes as unicodes
ah yes that
I'm aware, and it adds to that so it turns from \u00001 to something else
you can do .mode quote and then it shows them like this 💀
the overuse of 💀 is crazy
?kick @brave goblet reaction spam
Done. That felt good.
finally
Careful mrrioes you were in that too
you had sex?!?!?!?!?!?!
chat is weird today
How do I tag someone? I mean, how do I make it detect if the player has a tag like "test".
?pdc
pdc entries would consist of a key value pair so maybe permissions are better
both are weird ye
how can i cancel creative middle click clone
You can't, it's client side stuff
But you can remove the items once he drops it or place it in the inventory
can i cancel the nbt copy ?
What do you mean ?
You will need to strip the nbt when the item is placed in the inventory
you can clear the nbt when it is placed in the inventory
How can I exceed the 16 characters limit in scoreboard title? I have seen other plugins achieve this, making the limit 32 characters
What version is your server?
use 1.19
thank you
This limit was removed in 1.13
Too much of a performance hog for a lobby server which needs to have quick responses
And so Im using 1.12
lmao check #help-server, they just convinced a guy to use 1.19, maybe that will convince you
Your server is exposed to serious security vulnerabilities in this case
Im completely fine with that since the moment I set it to run in offline mode
i dont know if u can call that convincing
i still think he will use 1.8
No support for piracy here
😄
Sure, then why does spigot have the option to support it?
Convincing is pointless. Numbers dont lie. 0.7 seconds vs 4.6 seconds is a goddamn huge difference
because it doesnt need to provide an option
for what ?
Load times
outdated versions my guy
the circle has completed
maybe test 1.13
Ok but aren't you afraid that a hacker will destroy your server since the server software you are using has not been maintained for years and is exposed to many security vulnerabilities? This is what convinced me
it removes the limit
Tested, didnt work
maybe not so drastic as destroying the server
but still
the point stands
In my nation, the ratio of paid to cracked version of minecraft could easily be 1:1000, that is why I run offline mode
1.13.2 doesn't have a character limit for scoreboards
why not just make it flexible
no
You can put offline mode on 1.19.2 and not be exposed to security vulnerabilities dating back several years
put integer of length of string and then add the utf8 bytes in the packet
You dont
offline-mode
Let's go onto his ship and steal the gold
will you fix the problems on his country?
how are you still going on abt offline mode lmao
and how online-mode: true will fix his problems?
Ah yes, unfortunatelly, I have paid for my copy of minecraft. Not just once. Maybe a bit of reading would give you insight of my situation, but apparently that is not what smart people do. I never said I play on cracked copy.
why should i
ah i will just leave this as is
tho hackers will prob have fun with cracked mode
yeah thats a problem
and any name
but if you are willing to deal with that sure use offline mode idc
Anyway we answered your question. Either upgrade to 1.13.2 or bypass the limitation via packet or by using scoreboard teams
So it is literally not possible to exceed in 1.12?
hardly
Featherboard does that
You can, I just told you how
u could try hacky nms
pretty sure the limit would originate from the protocol
or spigot patches
idk why they would make a limit if itwasnt for packet size
if it werent for this
i stated my concerns on offline mode enough for the next week 😄
lmao
I do not need to update the imported jar in intellij idea from 1.12 to the latest one, right? If I just go with the long name and update the server it will work, or?
with teams yeah
You should give Slovakia and Czechia a visit then. Youd get a seizure
if you limit your clients to 1.13.2+ you could manually send a 1.13.2 protocol packet
assuming your intent is to keep the server version low for performance but allow newer clients
wtf
viaversion
Could ViaBackwards/Rewind prevent me from exceeding the limit, actually?
1.12 server -> 1.12 protocol -> 1.12 limits
same for 1.13
Yeah, but I got the same error with 1.13, as I mentioned
if your server base version is 1.12 no, its just 1.12
1.13.2?
yeah
not 0
.2
can you send the error
performance was sent flying out of the window with 1.13
true
Yea, but got better till 1.19
true
Ill have to replace the jar, moment
they tested 2b2t on 1.16 and 1.18 i think
In my experience, the performance of 1.19 is much better than 1.18, you should try
does anyone know if i can set the output location for maven package to some remote server folder?
i recommend using gradle because of the programmablility
true
I mean, Im willing to update my lobby servers, I will just have to live with it, but with minigame servers, I either will sacrifice load times or features
no
you can just code some quick java to upload the file after build automatically
its nice
- Do you know how I can repair my car?
- Buy an electric scooter
idk how to do that in java lmaoo
sacrifice load times it is
ok ill edit it to a recommendation
I don't understand why all servers keep all version compatibility and 1.8 pvp. It has been now 10 years since we see that. we want something different now
yeah
No one really tried to exploit the new pvp
Except some servers which did an awesome work
I saw a Skywars like that, it's so pleasing
i judt wrote a fabric mod to port Combat Test Snapshot behaviour to 1.19
it was a pain
java.lang.IllegalArgumentException: The name '§b§lTesting server' is longer than the limit of 16 characters
What is the best solution found during these 10 years to have a 1.8 pvp in the new versions?
Is the Combat Test Snapshot really great? I haven't tested this pvp
what version
1.13.2?
yup
i personally love it. tho its abandonned by mojank so i and alexa had to port it
ViaVersion 🙂
just to make sure, * after the plugin name means it is in some compatibility mode or something?
I mean, if my server is in 1.19.2?
But I hate this idea of making a 1.8 server possible for every version, we want the 1.19 features not the old school 1.8
Everyone should be in 1.19.2 today
I know but is it the best solution nowadays?
for those who cling to it
prob yes
or just
live with new pvp
or use my fabric mod :>
Link?
That's the point: no one want to feature the new pvp because they think all the players will ignore it
curseforge doing curse things
i just have the jar for u if u need it
It is too slow paced for kids
well quilt
shall i dm it to u?
Maybe, but you can add many things to it
Indeed it's really different, but it creates much more meechanics
Your server is definitely not in 1.13.2, just tested
Yes please
I doubt it would be the issue, but I used paper in that instance
I'd love to see it too
https://jd.papermc.io/paper/1.13/org/bukkit/scoreboard/Objective.html#setDisplayName-java.lang.String-
"IllegalArgumentException - if displayName is longer than 128 characters."
can you show some code
for( Objective objective : scb.getObjectives( ) ) {
objective.unregister( );
}
Objective test = scb.registerNewObjective( "§b§lTesting server", "dummy" );
test.setDisplaySlot( DisplaySlot.SIDEBAR );
Score stest = test.getScore( "magic sauce" );
stest.setScore( 1 );```
is there a way to check if a player is looking west
thats not the display name
thats the internal id
you need Objective#setDisplayName
oh so the objective name IS limited to 16?
yes
jesus christ
He doesn't belong there
lmfao
🤣
@sly surge @agile anvil there is a testserver for it. i will dm u both it so u can pvp each other
jezus is more of a 1.7 player
Amazing
block hitting it was?
aaaaaaargh why do I fuck up on things like thissssssssss
i personally am proud of how well it turned out. the community of playing this snapshot every day said it was 98% accurate
we even had to unfuck
minecraft code
as it contained bugs
I wonder what was Notch thinking when he was choosing a language to write minecraft in
together with the protocol
Im gonna ask this one ahead, you guys think 1.5.2 forge will connect to latest bungee/waterfall just fine?
Java is good
And the protocol was find on the begginning
It's just that it never changed ^^
I mean, it is not bad, but the performance is terrible for a game
my minecraft runs pretty damn well o.O
Well, its a voxel game afterall
Well then what is the issue in choosing that language xD
Drop a few big mods in and see the fps then 😄
I mean, drop a few performance enhancement mods in and see it go up
tbf, to some degree I'd argue that choosing another language may have actively slowed down/prevented minecrafts popularity
so many people learn java, the entire modding scene would be a lot smaller
same for plugins on servers etc
Well, it is true that c++ is less common
cpp is also just, a lot less friendly
I have learned javascript as my first language, to me everything is a lot less friendly ngl
Maybe lua would be good
lua is pain
I will make my own programming language
Call it English 2.0
maybe that would be easy enough
I mean java worked our really well
not to mention the huge performance gains in java on the horizon
that will certainly benefit game development in java
Well, if you look at it realistically, it worked amazingly, but looking at from our current standpoint.. well
The game would probably still perform better if rewritten in a c++ and a java plugin/mod interface would be introduced ngl
Maybe not so much on the server side
Well, you can see how well even a plain rewrite worked out in bedrock
Its microsoft...
I mean, windows occasionally tells me Im running out of memory when sitting on 60% usage..
how is your self-developed OS doing ?
point being, things are not pretty easy, you have to also obviously respect the business side of things
can you share the code in question ?
generally speaking, locations can have a null world
but if you grabbed it from a live player object that should not happen
uhh well actually, its for a home command, which creates a home object with the players location and the name etc, i later dereference it when saving it to the database
i created that home on the overworld and that world is still loaded :/
Am I the only one who doesnt see any problem?
You could try to get players world and set the location to his current one
when creating a new home it seems to work
Well, Im clueless
what do you mean, when creating a new home
hello, i'm trying to save all section created in a config.yml files that contains "name:"(String) and in it "commands:"(StringList) and it send me this error for each "name:" & "commands:"...
Here is my methode:
public void saveConfig() {
for (String section : getConfig().getConfigurationSection("Rewards").getKeys(false)) {
String name = getConfig().getString(section + "name");
if (name != null && getConfig().getStringList("Rewards.name.commands") != null) {
List<String> commands = getConfig().getStringList(name + ".commands");
rewards.put(name, commands);
}
}
}
created a new home object and saved it, so the location::getworld::getUID is called
and that seems to work ?
ugh when reloading server world is back null
that just sounds like you are fucking up loading
is that cuz world reloading or smth?
Need to add a period to your name getter.
String name = getConfig().getString(section + "*.*name");
Well, whatever your plugin loading logic does just is trash I guess
Any ref of an unloaded world will throw an error so it has to be loading
i'm still on the world so that doesnt seem to be unloaded :/
how do you load it from disk/db
if things work when you create it but then don't work once you reload the homes from the DB
your issue would be in said loading logic
wtf are you doing with name based uuids
im saving those as a byte array to the db
interesting concerning that named uuids are type 3
and that factory methods creates back an uuid from those bytes
and worlds and everything else uses v4 uuids
uhh it works lol
does it ?
Is it because Im a shit java developer or is his code actually clean af for some reason?
not for the homes 😂
lemme show how i save uuids
that might be the reason why it breaks
lemme print out world after loading

just properly reconstruct the uuid from a byte array
beyond that, by default byte buffer uses big endian
uh oh stackoverflow ig
what does ig stand for, except instagram
"i guess"
beyond that ```java
final byte[] uuids = ByteBuffer.allocate(16)
.putLong(random4.getMostSignificantBits())
.putLong(random4.getLeastSignificantBits())
.flip()
.array();
for a one liner
yes
private static UUID fromBytes(byte[] bytes) {
final ByteBuffer buffer = ByteBuffer.wrap(bytes);
return new UUID(buffer.getLong(), buffer.getLong());
}
private static byte[] toBytes(UUID uuid) {
return ByteBuffer.allocate(16)
.putLong(uuid.getMostSignificantBits())
.putLong(uuid.getLeastSignificantBits())
.flip()
.array();
}
Why exactly do you serialize UUIDs like that again? Because all SQL databases i know have a UUID type natively.
Does SQLite have a codec?
a what :/
holy shit this one got me
Do ChatColor variables represent a single character or more or tf is that even
They represent a ChatColor
Aaaand when used in a string?
oh right
is it possible to cancel projectile hit event and make the projcetile bounce
I was hoping to save some precious spaces in my scoreboard
ah
You shouldnt use them in a String. They are a styling component for text components.
Well, Im not, but I was thinking perhaps they are a single character when converted to a string
I mean if you are on older versions then they represent a single char prepended with §
So a white name would be "§fSomeName
okay ,i'll try, thx
why the hell flip the bytebuffer?
I'm a fan of components in most situations and rarely I get slightly annoyed
I mean flipping may make sense if you have different endianess, but at that point you'd also want to flip the mostSig/leastSig bits
I mean, you usually flip it if you want to read the stuff you threw into it right afterwards
flip is not really flip
Ah, just changes the read order? That is lame.
Flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it is discarded.
That does not define whether the underlying array is modified or not
Which I assume it would because otherwise you'd be dealing with pretty complex logic there
Does anyone know of an efficent way to perform ant-like property placeholder replacements?
So like replacing the string ${groupId}:${artifactId} becomes my.group:artifact for the Map ["groupId": "my.group", "artifactId": "artifact"]
While yes - I could iterate over each entry in the map and replace it manually I'd rather not do it given that I have no control over the size of it
final var buffer = ByteBuffer.allocate(2);
buffer.put((byte) 5);
buffer.put((byte) -5);
System.out.println(Arrays.toString(buffer.array()));
System.out.println(Arrays.toString(buffer.flip().array()));
yields
[5, -5]
[5, -5]
so at least the underlying array isn't mutated
adding a
System.out.println(buffer.get() + ", " + buffer.get());
after the flip also yields
5, -5
good to note
Um.. is string "" equal to another string "", I cant really explain this well
looks like the whole uuid thing is working
"".equals("") -> true
"" == "" also true afaik
Yea "" == ""
then tf am I doing wrong
there is equalsIgnoreCase
;==;
Only if they are interned
well "" == "" only because of a quirk
what does that mean?
you should never compare strings using ==
its comparing memory locations isnt it
== is
objects
new String("") == "" will be false
ye
string pool lifestyle
i mean
*Constant pool
let’s all use python
*Constant pool
even "l" == "l" wont return true will it
it would
cause it gets them from the pool
If both are in the constant pool yes
Aaaaaah
or if both are .intern()'d (which puts them in the constant pool)
literal strings are supposed to be in the pool iirc
interned strings 🙏
does ::intern() place them in the pool or smth?
killing performance one day at a time
So when set to a variable they wont be equal
memory leaks 😎
Yes, which is why you should not use it
doesn't spigot still use intern
Hence the name - it's an internal operation for the JRE to use
yea they do lol
well @eternal night thanks for helping it works
It does make sense if the string is going to be there for the lifetime of the application
e.g. plugin names
I havent really given java too much thought, I just noticed sometimes identical strings werent equal so I use .equals() on every occasion
Bukkit.getWorld with my weird uuid was returning null
You should do it anyways really
Unless you REALLY know what you are doing
I have not once ran into a situation where pushing a string into the constant pool is worth it
Im a javascript user, I just write code and pray to god it works
Well, a cpp user, but cpp supports these comparisons
although it doesnt support changing the comparison behavior
However == is going to be only a bit faster (talking in fractions of nanoseconds there most likely) than .equals because .equals's first op is basically if (this == other) return true;
but javascript is amazing, it allows you to do shit which breaks the whole thing
sounds like cpp when you say it like that
until i can var i = 0; i = ""; i = {} I am unstoppable
thats right, talk about memory in java.... what a pleasure using java becomes to me
meanwhile js function test(a, b) {} test(1)
Issue is that java has a verifier. Unless you make a seperate frame (which is harder than you think in this circumstance) redifining a variable is not going to fly by it. Although you can just cheat the system and internally just use a different variable
true shit
Anyone knows what's the max characters size for a Sign line?
I'm trying to change the sign line text but if it's too much length it doesn't insert the last word(s).
rewrite the compiler
The verifier is the culprit IMO
"1" + "1" = "11"
when using javascript i fear 2
xD
I meant, it wont return 2 but...
It wont cast a string into a number automatically
but "1" + "1" == 2 looks like something javascript could do
if someone sent me this I probs wouldnt look twice at it lmao
But hey, everything is an object
Some hate it, some love it, I personally love it
Is there an alternative for PlayerInteractEvent#getClickedBlock() in 1.14?
was that dropped?
not all API methods existed years ago when 1.14 was relevant
I know, but I see now that it DID exist, but my IDE can't find it 😛
Haha @steep surge
hope someone finds an exploits and RCE your ass
Oh @eternal night I found the issue, thanks anyway
sweet 👍
hope you are not planning on coding plugins 😅
For bukkit 1.14 is the oldest bearable version
I bring fear with my actions.
sounds more like masochism
oh
Yeah in this case it's not that you annoy other people (which you still do), but rather that you will shoot yourself in the foot
with 1.8.8 more like, in the foot, head, and chest
Yes, it has the worst possible API imo
Especially the material API on that version is 🤮
But Im not a 1.8.8 player
I quit minecraft a while ago, I just decided to make some plugins in my free time
Man doesn't even know that stone slabs are out
lmao
Although I wont act as if I wasnt playing 1.8 when 1.12.2 was out
And another issue with 1.8 is that paper isn't the beast that it is on 1.16+, so -believe it or not- you are suffering from sub-optimal performance
If speaking of servers, Im using 1.12
Basically the last version that performed reasonably for me
yo btw a "" string from my array is not equal to "" string apparently
Eh still a version that does not accept Java 17 by default (unless you disable native transport) so not something I'd use
What exactly is the array and how exactly do you compare them?
new String[ ] { "...", "", "..." }
please don't say you got your indices messed up...
then I for loop it as a string and use .equals( "" )
I wanted to see actual code, not pseudo-code
Ah okay
as of now I can only guess where the issue is
still doent work (same error)
Scoreboard scoreboard = player.getScoreboard( );
for( Objective objective : scoreboard.getObjectives( ) ) {
objective.unregister( );
}
Objective objective = scoreboard.registerNewObjective( "scoreboard", "dummy" );
objective.setDisplayName( title );
objective.setDisplaySlot( DisplaySlot.SIDEBAR );
Score score;
Integer i = 16;
Integer rI = 1;
for( String line : lines ) {
if( line.equals( "" ) ) {
System.out.println( "\n\nhaaa\n\n" );
for( Integer x = 0; x <= rI; x++ ) {
line += "§r";
}
rI++;
}
score = objective.getScore( line );
score.setScore( i );
i--;
}
}``` - this is the function I compare the variable in
Best guesses are messed up indices or invisible 0-width chars
brb with the array
What does your yml file look like?
And how have you determined that line.equals("") is false?
well, because my haaaa is nowhere to be found
ah lol
Well, you can't have a parent section with a variable if you have subsections. You would either need to use the name of the parent section itself or add another subsection called name.
Yeah then my only guess is that you have a zero-width char (or a special string such as color codes) in the line
my IDE put spaces in the strings...
Wouldn't have happened with eclipse 😎
Isnt eclipse like 1.8?
oh i see, i'll modif this
At least is isn't legacy software
You make me feel old
And well using tools from the stone age is the norm for programming
I dont even have the latest discord installed
There is this xkcd about how most people use stone age tech to create bleeding edge stuff
That guy is a RCE test box
Is there any way to parse markdown into minecraft formatting?
markdown?
There is MineDown, but it isn't true markdown syntax iirc
Yeah stuff like in discord **bold text**, __underlined__
Yeah I know
Also Minimessage and whatever - they are all Markdown inspired, so most should have similar syntax
But
So i wanna convert that markdown to display correctly in minecraft
Minedown is probably your safest bet however
It's time to train using Regex, nice exercice
Unless you want to operate with headers, list and all that stuff
lmao
Well how do i use that in code?
Yeah i guess
Or ill check the code of other plugins :kek:
Import library and pass string through method?
Pretty sure they use Regex
yeah, thats not a problem
ah isee
It has nice adventure interop - so it is nice to use on paper servers. No idea about the spigot interop
is this the default option?
So like i dont have to specify open_url
that would make sense
Actually i dont even need to parse image links
That is the advanced syntax
yeah i know
i see
or this rather
but italic is this?
and not one underscore or one star
thats the standard md
Anyone fan of custom ui GUI?
custom ui GUI as in?
But you see the * or _ for italic in most "flavors"
Example:
ive never seen two ## for italic text
Probably was easier to implement. Shouldn't be too hard writing a regex to convert between the two
there is no way this shit is vanilla
this is vanilla with a resource pack
It is, but few versions after you xD
Its kinda insane what you can do with resource packs
but just take a look at origin realms
No one use the capabilities of resource pack, I want to change that
oh, that is achieved with data packs isnt it
Resource packs, not data packs
probably also a plugin additionally
Eh, I myself don't use it given that usually the Chat is a bit more powerful
but you are still prompted to download the rp arent you
So, I am wanting to create a GUI where you can change the plugin's language files. As it stands, I have the GUI set up dynamically so that it can detect any new languages added or removed. However, I want the ability to order the languages in the GUI. Anyone have an idea how I could do this without adding extra data to the language files themselves?
It's really fluent since 1.18 or smth like that
What do you mean by chat?
I'll show you
json -> commands i guess
Indeed that's interesting
You can also make it interactive with click events and all that stuff
gnome 👀
Thats cool and all but it isnt as clean as guis can be
I use it in all my plugins these days
im a kde man
if it werent for my gpu drivers i would use linux as my daily driver as well
actually maybe heard once about that
Although I still look back fondly at gnome's stability
Although thankfully all my problems with LXDE have magically vanished after not using my computer for 2 weeks
you just had to get a bit outdated you see
ah is lxde the default fedora desktop env?
No, gome is. LXDE is just a spin I wanted to try out
hmm
But yes, it's fedora
I mean look at what you can do
are you shitting me
fortunaltely not even that hard 🙏
tho some better support for that, looking at you bedrock, would be nice
Discord hates "nonstandard" encoding standards
where are the old good days when having a custom gui in a goddamn forge mod was impressive
oops, well MP4 is standard I guess
mp4 is just a container
right
Is another example of text-based UI
xfce is very used nowadays
I like the idea but unfortunately you miss some chats during this time
Yea, that's the issue with chat based UI
It could be great to restore all the missed chat during the interaction after closing
kali
You probably could, but you would need to keep record of every message sent and any possible integration with existing chat plugins.
loud keyboard lmao
good microphone
Most servers I've played on had a dead chat so I cannot talk too much about it
That's right, and that's why I'm staying with chest GUI
@kind hatch EDIT: It works right now, thx a lot!
you dont know what a dead chat is unless you play csgo with russians
they either shut it for the entire game
or they dont close their mouths
Even when two players play at the same time there is 0 interaction
I used to host a smp for a while and I saw more killed by creeper explosion death messages than you have player interaction
Bump
hmm my stuff seems to work
uh oh im making some kind of kingdoms server
oh cool
Any arbitrary order of the languagues themselves. For instance, instead of sorting alphabetically, I could have a custom order. Smth like
English, Spanish, Russian, Dutch
vs
English, Italian, Spanish, Dutch, Russian
heyyy youre still gooooood, Im making a scoreboard for myself and struggle with it
just implemented some basic skills where you can gain xp
I'd sort over locale.getISO3Language();
I personally use locale.getISO3Language ALL the time even though it might not be the best for performance but whatever
Sounds good
figuring out a way to hide that bossbar after some time tho
but get it back when i gain xp
dunno havent worked with bossbars yet
I had an idea of a minigame I think will be fun to play so just like 2 days I got into plugin development xd
I consider myself an expert in getting the player object
At worst just sort over the file names themselves
had so many issues implementing persistent storage lol
gson fucked up so hard and sqlite decided to do that too
So something like
TreeSet<File> file = new TreeSet((f1, f2) -> f1.toString().compareTo(f2.toString()));
before parsing them into a kust
I have created an additional nodejs server to handle all persistent storage and general events over the network
Well, I'm sort of using the language codes. locale_en.yml and what not. However, how would this allow for a custom sort?
Certainly not the best approach but it does its job just fine
TreeSets are the most obvious choice there. If it needs to be concurrent go with ConcurrentSkipListSet
How to understand knockback pvp system? And get exact values of kb multipliers
math
Dive into minecraft server code 🤿
holy shit he cracked the code
I'm not following. Wouldn't this just return the natural ordering?
But really I'd need to look at the code you are using
anyone has an idea to use neural networks in?
Yes - but if it needs to be a pre-defined order you can just alter the comparator to use pre-made ordinals
Take your favorite game, find a goal, and train your neural network to reach the goal
I tried, i almost started to think it is client side calculations
Speaking of which, is HashMap a good choice as somewhat of an alternative to java objects for storing data?
HashMap is cometimes a good choice, sometimes not
no
what
lmfao
if clients control kb
then pvp mc servers would die
For example for having a Chunk -> Data - like mapping, HashMap is not ideal performance-wise
No way, but the client can indeed intract on it cause it's client movement... But vanilla minecraft doesn't
It does need to be pre-defined. That's also part of the problem I'm running into. I know I need some sort of data, but I don't want to put it in the language files themselves.
I believe that is the case actually
Can you give me advice what classes might be involved?
Have a Map<String, Integer> then
The server is trusting the client with a lot of inputs - including knockback
oh nonono, just for like player objects I have over here. eg <String, Object> and I assign an object with keys like coins etc to player names
although for non-player knockback that may be different
Fair enough, but where would I get the integer from? Where would be the best place to store it if not in the language files directly?
DO. NOT. ASSIGN. ANYTHING. TO. PLAYER. NAMES.
cant on offline modeeeeeee
🫂
Yeah, that would need to be predefined in either a file or in code
I did 1.8.9 build tools project and tried to explore whatever i see
Dont you get null as an UUID from a cracked client?
Every account has an online and an offline UUID.
so it would a reliable identifier even for players with cracked clients
UUID.nameUUIDFromBytes(("OfflinePlayer: " + player.getName()).getBytes(StandardCharsets.UTF_8))
The offlien UUID is generated a bit like that
Offline UUID is calculated from their name
Oh thats cool, didnt know that
Even in vanilla
One more thing to add on to this. If I make a predefined list of languages and their sort order, what about cases where I add or remove a language from the plugin?
I think adding is easy, something like taking the total amount of language files and then add 1 so that it's last in the list? But, what about removing language files?
Either way, HashMap<String, Object> for player data, good approach?
Since you will be comparing these integers removing will not make a difference
Map<UUID, PlayerData> he said
^
oh right it has its own class
Though don't necessarily use PlayerData
I just have a native java object there
i'm doing a Map<UUID, KingdomsPlayer> to store a playerwrapper thing
The string -> int map can be much larger than the actual amount of locales there are out there. It will not cause issues until you map multiple locales to the same ordinal
Is there a way to remove entity AI, keeping their gravity, without using NMS? If not would replacing the entity with a custom one without any goals be feasible? I'm trying to prevent certain entities from causing lag with their pathfinding
I wouldnt really like to get into custom classes for players etc, I feel like just putting and removing data from the object is simpler for me
So you have a map for each variable ?
While that approach may be okay for you, it may become problematic once you want to store it persistently
The hashmap contains native java objects, there the data is stored
What are "native java objects" for you?
pojos i guess
The java/lang packages or are we talking about JNI?
Object from java.lang
For reference "native" usually means native (machine-code) in java space
Would quickly become a problem when storing more than two stuff for each player
well really that isn't the issue
what makes you think that
I see too much issues on doing that
You need more memory, your data is harder to store, manipulate
and co
Memory is cheap - programmers are not
(plus it is a teeny tiny bit faster since you avoided a GETFIELD/INVOKEVIRTUAL op)
Im not too concerned about memory, afterall there arent gonna be their house schematics stored and about data manipulation, I mean..
Its quite easy to just playerdata.get( uuid ).get( "group" ) or whatever
it perhaps isnt as clean as it would be with classes but I dont think thats too much of an issue
Then let me give you an heart attack: https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/common/util/RegionatedIntIntToObjectMap.java
what the actual fuck is that class name
The best thing about this class is that I wrote it to save memory
It should've been ConcurrentRegionatedIntIntToObjectMap now that I think about it
Oh you have a Map in a Map ? I didn't understand that ^^
That's lovely
JSON moment
:DDD
HashMap and Object both have .get() method
So what's your structure ?
Im gonna try my best in explaining then
Just show it ^^ like HashMap<....>
ye ye
Hello, I want to know why tab completer doesn't work for capitalized words?
It uses like 800k bytes if only a single object is stored in it
on login I retrieve data from mysql
Don't ever touch mysql if you have never touched it before
I have, dont worry
Too many people in this channel have issues with database servers
its just java Im new to
players.get( uuid ).put( "lastSeen", ... );``` You mean like this?
Yes, but now do it persistently
looks like you are doing a map<uuid, map<String, object>> or smth
I've never seen that before x) Maybe it's my time to have a coffee
Loading and saving is a bit more complicated if you have multiple maps
However, you can just strap GSON onto it and call it a day
had so many issues with gson
i eventually needed so many typeadapters that i gave up
When the player is joined, I query all this information and store the object until the player disconnects, then I just release it from memory. When something needed to be saved occurs, I just directly save it to the database (mysql)
it didnt know what to do with records, weakreferences, custom objects pff
and of course update the locally stored variables
typical google moment
well, basically yes
Most of the stuff google releases are legacy software
Actually, would there be any difference if done likewise, geollll?

