#help-development
1 messages ยท Page 361 of 1
uh ok
uhh
whats ur server called illusion
woke up like 2 hours late
ndas havent been filed
wait
today school ends a bit earlier
so youre a student and a business owner
at 5pm
why are you at school at 4:21
how tf did you manage that
I'm a student, developer, business manager
magic
deal more drugas
you got melatonin
school usually ends at like 6pm
8am - 6pm
well
I am developing a system where players have a "potion bag" that holds potions. It is an actual item, and can be dropped and picked up. I was curious what would be the best way to verify that the "potion bag" is truly a potion bag, and what potions it contains. I have a few ideas, like saving the actual item to a DB and attach some sort of identification number to its lore or NBT data, or I could base it all off of what the lore say's it is and what it contains. Or, I could use a system that keeps track of the potions/potion bags inside of a players inventory (including a database). What would you say would be the best way to achieve this? (I am asking because I dont want to waste time on something that wont work or will be super inefficient)
there are like 5 pillars in my life
one of them is sleep
that pillar is very short
?pdc
item stacks have PDC, and PDC data is unque per plugin applying it to something. So just attach a boolean 'is potion bag'
check the link ig
and then I guess I could attach a string in a readable format for which potions it contains?
?morepdc
You can create custom persistent data types on your own, or use one of the many libraries available which have implemented those which match your needs. Learn about more persistent data types here: https://www.spigotmc.org/threads/more-persistent-data-types-collections-maps-and-arrays-for-pdc.520677/
using that you can apply a list
interesting
well either that
or you can make use of that object to and from B64String and store that
alright. Thanks for the help, I appreciate it ๐
Oh I KNEW IT. He also contacted me at some point too
He doesn't work for free :)
@echo basalt I can't seem to figure it out, because if I multiply by 0.005 it's just slow in all directions, I can't figure out how to make movement faster in the velocity's direction and slower when against it lmao
entity.setVelocity(vel.add(toAdd.multiply(0.005)));
Setting pitch, yaw and roll for minecart
Yeah that's gravity
Ik
is there any way to get around that?
No
Client sends packets for its own movement
You can just apply your constant vel
The client can battle it out naturally
Yeah I got it working, only problem really is I want to aid the client to move against the vel if it's doing that
so I probs have to use PlayerMoveEvent, calc the vel, and store that myself
how to hide player's name tag with packets?
Is there a way I can stop the primary world from saving chunks/entities, I know you can unload a world at onDisable, but that doesn't seem to work for the primary world.
?paste
declaration: package: org.bukkit, interface: World
Hm but this does not prevent saving on shutdown
Well then simply create a zip file and replace the world folder onLoad()
EnchantmentStorageMeta bookMeta = (EnchantmentStorageMeta) book.getItemMeta();
Bukkit.broadcastMessage("Counter: " + bookMeta.getStoredEnchants().values().size());
Map<Enchantment, Integer> bookEnchantments = bookMeta.getStoredEnchants();
if (bookEnchantments.isEmpty()) return;
i have this code that checks for custom enchants on an enchanted book, but it returns an empty map?
im using EnchantmentStorageMeta#addStoredEnchant
when i try "/data get entity @s Inventory[1].tag.StoredEnchantments" it says it has the custom enchant on it
You are probably not setting the ItemMeta back on the ItemStack. A classic.
Hey ! I have an armor stand with a gold block ad head.
Currently, only his head is visible and that's what I want.
But the problem come when the stand is glowing, all the rest of it's body become visible,
Is there any ways to make only his head (Gold Block) glowing ?
look at the last line in my message...
I see. Is it a custom enchantment or a vanilla one?
custom
I would have to look that up but im guessing that the spigot method does not account for custom enchantments
depending on how they are applied/registered
Try setting it as a marker
Any documentation page ?
declaration: package: org.bukkit.entity, interface: ArmorStand
Thanks a lot ๐ !
It worked !!
But now the custom name is on the stand feets,
I assume that it can be because of the new very small collision box making the top of it's head at his feet
Any ways to deal with that ?
Deleting region, entities etc on disable worked fine ๐
Wasn't aware that worlds finish saving before plugin onDisable is called
Not really. You can create a second AS above for the name display
Okay ! Thanks for your help ^^
is there a way to remove 1 of an item from an itemstack
doing setamount(x.getamount()-1) works but wont remove the item if theres only one left
or should i just do an if statement and set it to null/air if theres only 1
What version are you on? Because in newer versions you can simply reduce the amount and the item gets removed.
1.8.8 (dont just say to update the version)
Is there a way to set yaw and pitch of a minecart without it resettling itself?
?1.8
Too old! (Click the link to get the exact time)
bruh
Use ancient APIs -> deal with the consequences
If you want lower versions you gotta deal with the consequences
if im using an old version, i know well that its old
Yes, but then it's also up to you to deal with your item stack count removing and not spigot
just write an if statement then
1.8 is slowly vanishing every day and it makes me happy. Last time i checked it was 7% and now only 5.7%
where can i download 1.1?
Is there a way to set yaw and pitch of a minecart without it resettling itself?
I would still like some help with this as I havent been able to solve it
provided means the classes will be found, eg like spigot-api. compile means the classes are added into your jar
been as they dont exist on the server
read my mind
?paste
ohhhh
I want the decentholograms plugin to work
its dh, that should be scope provided but needs the decentholograms plugin on the server
yeah
is there a way to avoid that?
not many standalone hologram plugins exist
like ideally I just want users to just download my one jar file to use the whole plugin
hmm
there is a way to supply the plugin to the server from inside your jar but idk how that works
decentholograms is the only good one that i know of
yeah thats what I fear
oh well, I guess I will have to make something quick myself ๐
holographic displays exists but doesnt support all features dh does
hmm
it looks good enough for me
thanks
oh
wait nvm it also doesnt work xD
same issue
im already tired of this dependency bs, I guess thats my up till now all the stuff I wrote doesnt rely on them xD
I will just make something myself
Checking a project that uses 1.15.2 nms, what is Block.n on that version?
Why the heck mongo doesnt allow parsing integer nor doubles? Is there something broken on new updates?
uh i forgot but does mongo have getDouble or smth?
im thinking about ((Number) x).doubleValue()
Yeah its has the method for getting int and double vlaues, but its throwing an exception
I thinking lib is broken or something like that
what ex
how to let the armorstand in sneak state i need to change his nametag's opacity
is there's any method or packet?
ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
But what makes me laguth is that i never adding a integer to a double field
Doesnt make sense tho
I will clear the whole db and re check my code again, maybe the issue is with the db documents
403, Forbidden
im currently on Linux, it just crashed haha
what distro
Ubuntu 20.04, its goes frozen and then just auto restarted
ew
that why we should now a day work directly over the cables instead of having fkg OS, which just makes pcs to crash cuz of high resoruces requires
BsonType type = reader.readBsonType();
...something
case DOUBLE -> double value = reader.readDouble();
With latest java driver
doesnt document allow get("val", Number.class).doubleValue()?
Why would your ever use documents?
Hmn, what do you use tho?
I just that mongo has 3 ways of using it, documents, schema things and ORMs
I implement a good Codec<T> and then use a MongoCollection<T>
Ohh right, you are using Mongo schema pattern
@Override
public void onEnable() {
// Register the event listener
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
// Get the message and player who wrote it
String message = event.getMessage().toLowerCase();
Player player = event.getPlayer();
// Check if the message is "hello"
if (message.equals("hello")) {
// Write "hello" back to the chat
player.sendMessage("hello");
}
}
}
What is wrong here ๐ฆ
Please format your code
how
codeGoesHere();
Okey really weird, OS crashed cuz of Mongo server ๐
Run your DBs in a docker
mongodb cloud kek
yeah ik, so far was just for testing (because my dedicated server are off, cuz of some config issues) i just did something fast just to check
I was using it before, but stopped workinjg the connection with no reason tho
Just saying an auth exception but credentials where okay
?paste
i dont really like the ip whitelist
What is causing this error:
[19:51:54 ERROR]: Could not pass event PlayerInteractAtEntityEvent to GTaser v1.2
org.bukkit.event.EventException: null
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:72) ~[patched_1.12.2.jar:git-Paper-1620]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-1620]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1682) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:49) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:6) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-1620]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-1620]```
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-1620]
at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException```
CODE: https://paste.md-5.net/fojibemaqi.java`
it doesnt work with dhcp
What? I never use that with mongo cloud
My god 
@Override
public void onEnable() {
// Register the event listener
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
// Get the message and player who wrote it
String message = event.getMessage().toLowerCase();
Player player = event.getPlayer();
// Check if the message is "hello"
if (message.equals("hello")) {
// Write "hello" back to the chat
player.sendMessage("hello");
}
}
}();
Please dont resend your code and format it, also if you want to persist your message, please open a thread onthis channel
probably a nat thing, whenever my external ip changes, it complains and throws some stupid errors
i did the same
No you didn't.
Ok, maybe the code sucks, but what is causing that error
You were given an example.
So far not wondering to be rude, but stracktraces is basic java
i tihnk i didnt understand
Full stack trace please. Important part is missing
it is full
Agree
No, its no the full issue cuz we cant see the line where the issue is caused
If that wasn't good enough. Read up on how discord does markdown formatting. https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-
But you literally just take your code and surround it all with triple backticks.
This cant be the full stack trace. There is nothing related to your code in there
@cunning bane You can also paste your code here:
?paste
public void onEnable() {
// Register the event listener
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onChat(AsyncPlayerChatEvent event) {
// Get the message and player who wrote it
String message = event.getMessage().toLowerCase();
Player player = event.getPlayer();
// Check if the message is "hello"
if (message.equals("hello")) {
// Write "hello" back to the chat
player.sendMessage("hello");
}
}
}```
i got it ๐
Just missing the java tag
ty
ninjad me
what i need to do for it?
Explain what you expect this code to do
im new sryy
In the console i have only that error
Syntax highlighting is why you'd do it.
Wrong reply.
if someone write hello it should be say it back [hello]
Caused by: java.lang.ArrayIndexOutOfBoundsException <- This has to be trailed by more information
That is no the whole issue, check your last file log and please send code - What Smile already told you
?paste
?paste as well
They are all like this
I try my best thanks
Yeah your code should do exactly that
you mean its ok?
Does your class implement listener?
Also please mpiza if you will ask for help, provide thw hole issue and code too, if not its imposible to get helped
how can i see it?
Restart your server. And try again....
It have onEnable, so I assume it extends JavaPlugin
He would not be able to register it otherwise
right, he wont be ever having the exception if listener wasnt registered
sry but im not fast in learning
I tried, the is this error to org.bukkit.event.EventException: null
i only have the class i pasted using that event
But did you learnt the lang where you are codding?
Well JavaPlugin does not inherit from Listener. Only from CommandExecutor
?paste the error
And also ?paste your whole code
Exactly, so they still need to implement Listener. Even if they are using the main class.
Yeah we know, but if he didnt register the listener, the exception wouldnt appear
The IDE might throw a warning, but it'll compile regardless.
It does not? ๐ค
I have never seen a more useless exception. What java version are you running?
it does
Yeah, spigot exceptions are pathethic i can agree with you
He's running paper.
java 11
?whereiam momment
Yeah but they already registered 'this' which would be a compile time error if the class wouldnt implement Listener.
Thats why i assumed he already implements Listener.
๐
Paper ๐
stfu
I was reffering to Listener interface, was sure that JavaPlugin implement it
There is no such thing as "spigot exceptions". It just depends on your jvm
english-english please!!
google it
That's English English
No bruh, you englishes talks really bad because you dont use correctly the lang
It's called slang. Spanish also has it.
Englishes means, english people in general no the one from UK
you sound like the dude that wrote "the dirty of the water" on his test instead of "water pollution"
Well we cant help you at all with this...
Add a huge try catch block around your method and catch Exception
Print the stack trace and show it.
How else am I going to pad my word count? lol
it was a written one and it was full of cringe stuff
"i talk the same speed as my mom"
okay, definitly mongo is broken, i have done the whole codec for working with Mongo Pojos, and stll persisting the parsing issue
Maybe has to do with the driver server or cliente, im not sure i will make a issue request tho
weak, just add random text with the white background
That's the easy way out.
Englishes is not that.
๐
This error appears at random, the plugin work correctly for like 5h hour or more and at random it starts giving this error
5th time we tell you, provide your WHOlE code please!!!! - sorry but you already stressed me
The error is an ArrayOutOfBoundsException, so wherever you are dealing with arrays, I'd start there. Did you make any changes recently? Also a good place to check.
Scroll up to the first occurrence of this error and see if the additional info is not truncated
m 100% that he is not sending the stracktrace, and just copy-pasting some part of it
This is going to be a search for a needle in a haystack if we dont know where the exception comes from...
just throw the whole latest.log in a paste
I tried to check the Arrays but i don't know exactly what to check
It was the firs thing i told him, but he didnt listen... ๐ฌ
I strongly suggest getting a proper stack trace. Then we can solve this in <2mins. I promise.
True, but I've had useless exceptions thrown before and I know it came from a recent change. It's likely to be a similar case here.
Will too many armour stands, custom mobs lag out my server?
Maybe
I don't know how to trigger the error, so it will need time
Too much of anything can lag out a server. Just depends on how much data is put onto each armorstand.
All depends on your server resources and how you code it, ram mememory you assigned, etc
Like around 10,000 armour stands, being animated, moved and actions at a time
Armorstands are entities and eat quite a bit of computation time.
Thats why almost all advanced plugins working with armorstands only use
packet based ones.
100% will lag your server to death
Could you tell me more about packed based ones?
That might change with the new display entities that are coming, but that's a future thing.
What is that?
So stoked for them. Even Holograms could be overhauled then.
I don't mind waiting another update if it will help with performacnce ๐
A wonderful new feature that's coming in a later update.
There needs to be like 10k-20k custom mobs at a time
Geez, that many at one time just sounds like a performance nightmare.
Is there better way to make custom mobs?
What are you even trying to do?
Itโs basically fake mobs etc. when itโs using packets.
Because there is no way this will ever happen
Basically a modded server without mods
And what do you need that many entities for?
Not really. Sure you will likely be able to use them as packets, but it's a real entity that doesn't tick and has no collision physics. It's similar to the marker entity that exists, but they are so much more flexible.
Yeah in the neighbourhood of 10 - 50 depending on your settings.
Yes, so I need the custom mbos to be like normal mobs
I want you to see them naturally around the world
Monsters at night, animals in the morning
Alright, still waiting for the calculation where you scale 10-20 to 10k-20k
500-700 players
If you can run a single server with 500+ players on it at decent TPS, I'd be surprised if not awestruck in how you managed it.
There is no way on this earth you will ever have 500+ players on a single server.
You would need a highly optimized custom server jar to even reach 200 in a stable manner.
No, we have that sorted, it's multiple servers, being copied to eachother from one main server
With a very very forked spigot jar
Spigot/Paper etc will never handle that many players. Especially not in a vanilla world.
A lobby can maybe hold 400 people if the backend runs on an extremely optimized 1.8 server jar
Then your server load is going to be relevant to each server. Find the max cap for each server, then use that for your calculations.
It likely won't be 10k for each server.
But those mobs need to be disaplyed in all servers ๐ค
How you do that is up to you, but the point is, they aren't all going to be on one single server. Find the individual amount per server.
Thank you for this knowledge
I already got my servers, and jar sorted with experienced developers, but thank you for the knowledge
Are there better ways to make custom mobs?
You will need to handle the entities in a custom (multithreaded) layer then. The server can never know of those entities or it will die.
This server is so much trouble for me ๐
Yeah, 10-20k of entties are too much for a single threaded server
And very costy :(
This happen when people do their first big project, next time you know that its not so easy as it sound
I want to clarify something. Is this like a master/slave system where all slave servers copy from the master OR are all of the servers synchronized as one?
Pretty sure it's synchronized, but I would need to ask my developers
Would you be a bit free, to explain this more please? Its a really interesting topic for me
what it does
My admin, can join from a turkey server and I join from the germany server, and we both see everything same
So its a syncrhonized server if im not wrong
You basically proxy the packets in an extra layer. This is going to be very difficult.
Also without a multi threaded server, will be really difficult because of enttiest high resources
Some new entities were introduced that are far less resource intensive. They also have some really cool properties like being able to scale and transform block states.
But now the entities need to know the state of the world in order to move
cool
You can read up on it here. https://www.minecraft.net/en-us/article/minecraft-snapshot-23w06a
Anyone interested in a job to lead my developers ๐
?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/
Yeah unless you have like at least 5 very experienced devs and 2 years to spare this is not going to happen
What I just said? It already works
Yeah we understand, but project wont work if you dont focus on that, its too much work
Or are you talkign about the mobs?
Why not, I think it will be worth it
Im talking about the scope and scalability you want to achieve
Agree with smile, the project will have lof of scalabillity issues
Said it as a joke ๐
You cant ask for paid help in spigot, you must use the services url
I mean it's going pretty good, the servers work perfectly, we have custom items, custom dimensions, biomes, blocks
My bad wasn't reading context
Smh Verano
We know that cuty, but that doesnt mean your project can scale pretty well
Smile is refering to a profesional usage and future implementations
I was already getting around 1000 players daily in our server before, almost everyone seemed to be interested when we introduced this
There where worse times with him. I still remember when he joined the server.
Left me speechless several times each day for weeks...
I'm aware xD
I sometimes wonder how often the language barrier makes it seem dumb
Well, thank you guys, I will continue working on this but I will be here often ๐
arent you native speaker?
XDD
Of English ofc
To be fair linking two servers isn't all that hard depending on how do you it
3rd time, I already have that sorted out ๐ฅฐ, thank you
He is not tryingt o link only servers, he wants more
Well, it would be helpful to know exactly, but I can elaborate for both scenarios.
If you have a master/slave system, and assuming that each server is identical in specs, then the total amount of mobs per server will be identical to the master server. So if the master server has a cap of 50 players, then at max, the total amount of mobs will be 1000. Which should be fine given a standard spigot jar.
If you have a synchronized system, I hope that you have some sort of system that delegates mob spawning. Because copying from each server without proper management is a recipe for disaster.
Just saying language barrier probably makes you sound more stupid then you are xD
Me? Im mean im realy not inside the context, you brokn my braineds
Alright, thank you I will see
Kindof new to the convo
I'll dm you in spanish gimme a minute I'm not on pc yet
Wait, would 10k-20k NORMAL minecraft mobs lag out?
Yes ofc, entites are really resource intensive
Okay, thank you
It would for most. Entities are resource intensive.
Minestom?
Its like a spigot, coded from the scratch
Not a fork
My bad, wrong word
Ah no we aren't, we have our own
And not even spigot. Spigot but coded from scratch would be glowstone
But does your own support multi threaded?
We are talking about scalability, so without using multi threaded for your mc servers, you wont scale as you expect
I'm not good with servers ๐
Can you tell me, what multi threaded is?
tf is glowstone I've heard the name just not sure what it is
Man, that's an old one.
Minestone its called the mc server coded form Scratch
Minestone is the new one, that is the old one ๐ค
Not really
I just heard about Minestone, never about glowstone
Glowstone is a bukkit implementation, Minestom is a multithreaded minecraft server impl
And what have to do Glowstone if it isnt multi threaded, sorry im confused
Well technically Minestom is much more since it's basically many small servers running as one big server but that is an implementation detail
This can get really technical, but the simple answer is it's a feature of the CPU that lets programs split up tasks onto different threads. They will execute at more or less the same time, so it's used to speed up programs or offload intensive tasks away from the main thread.
I was talking about future scalability, so i telling him that without custom multi threaded mc software he wont be able to scale how he will expact
Isnt glowstone dead? Havent heard of it for a while
Oh, ye I know what threads are on a cpu, do you mean is each server cpu multi threaded?
seems like it hasn't been updated in 8 months
It's mostly stuck in the past. Never got past the flattening
on the github page
there is a pr for 1.19.3
I have 6 servers, they are all multi-threaded
Most CPUs are multithreaded. The difference lies in whether or not the programs you use take advantage of it. It is a complicated thing to work with so most programs only use up to 4 cores at most.
However, they were trying to figure out if your programs actually take advantage of it.
The type of multi-threaded is perhaps the bigger question
Well minecraft for sure is not. And if your devs are weak then multithreading can absolutely hurt your performance.
If you just multithread things like work ticking to run in a parallel manner it isn't impressive
Ah so, I need to split the tasks between the threads
But multithreaded block/entity/whatever ticking is impressive
Imagine the race conditions and sync issues. Ugh.
Yeah, that would be the result of many months of hard work. Hence it would be impressive
And then you have the issue that no plugin will work with such a system
You'll basically have to redo everything from scratch
Hence why Minestom does not and will never support bukkit
Btw where is the old man? Havent seen him since i got back here.
Pretty sure our jar has multithreading, but again I would need to check with the devs
@grand flint To summarize everything we are telling you, is that without using a well designed mc server software which makes use of multi threaded and correctly implemented, your project will not be scalable in the future. Since as you have been told the entities are intensive operations, which consume too many resources. And without an experienced devs and engeeniers it wont success
Elgar? He's still around
Yes him XD
On the other hand - 20k ticking entities are very hard to achieve
<insert minestom here>?
regionalised ticking of entities would fuck plugins to a point of no return 
You either need insane single core performance or create a tick skip for entities which are far away
For minecraft specifically, you need to do a little more than that. The issue with the game is mostly single threaded. So by default, it's not taking advantage of the capabilities of a multithreaded environment. This is a little problematic when it comes to server jars since they have to abide by that rule. At least for the most part.
We can make our jars asynchronous, but we ultimately have to return the results of those threads synchronously. So if you wanted to make your jar multithreaded, you'd have to send things back to the main thread anyways. Otherwise you'd have to rewrite the game and that isn't allowed. Your devs have probably already run into this.
Or at the very least it should be easy to purge large amounts of these entities to be non-ticking (which is what paper does agressively with fishies) or to just lower entity rates to be lower
Alternatively, just reduce the amount of ticked chunks (i.e. reduce simulation distance)
you certainly can rewrite the game
tbh, regionalised entity ticking is doable for sure
Isn't rewriting the game, like mods kinda?
Isn't that what simulation distance is for?
java.lang.IllegalStateException: This registry can't create intrusive holders
BuiltInRegistries.BLOCK.createIntrusiveHolder(this); Block.class
BLOCK = registerDefaultedWithIntrusiveHolders(Registries.BLOCK, "air", (var0) -> {
return Blocks.AIR;
});
``` BuiltInRegistries.class
Minecraft, the confusing
But can you do it every time a new version releases?
No, that infrige ToS and Eula
But would you want to?
yes
myeh, depends
Yeah but i was thinking about something more dynamical than a hard cutoff
masochist.
why is this not working?
the logic you extract is not that difficult to maintain
sub class
I have seen an spanish dev which was punished my Mojang because he re writed a simple mc client in unity
I still expect around 2k LoSC of changes

you can run whatever the fuck you want as a server
if the spanish dev writes a minecraft client in unity
and sells it
different story
Is not diffcult to mantain, but think about scalability... it wont success
^
And let's be honest: If it doesn't fit in a simple ASM Transformer, I ain't going to bother updating it
the paper patch for offthread chunk loading is ~10k lines
so like
nah
You need to use an unsafe cast to ActionQuestRequirement<T>
I mean 2k lines in mojang code
So, I can make custom mobs from armour stands, if they are multithreaded properly?
There should be more in non-mojang code but that will be very static
it is all very static yes
Can plugins manage thread usage?
you just redirect all of your server logic into a second implementation basically
and just use mojangs called methods as entry points
They can create new threads and use them - but they can't tell other things to use threads
Fun fact, multi threading chunks is actually somewhat easy
Help clear something up. What do you define as custom? A display name? Different behavior from vanilla?
Just update them at interval orders
with a simple ```java
if(true) {
doOtherStuff();
return;
]
mojang code here
no issues there
you barely have any diff for the insertion
Of course, editing the actual code, that's different
Yes, it looks different, it has custom animations, it has a different ai
.
That means you have to get the class the recompile. So basically you have MCP 2.0
hm ?
Because currently you have an ActionQuestRequirement<?> which means the generic
methods in there dont know what objects they are allowed to use. The type is erased on runtime
so you need additional checks for this. You should never have an ActionQuestRequirement<Event> btw.
what do you mean "class the recompile"
Copy paste the method and ill add the fix
You are likely to change some descriptor and in that case Mixin is insufficent and raw mass ASM is sorcery. So recompilation it is
well yea
obviously
no one in their right mind would do that without a proper server fork
lol
yeaaa 
private void increase(Event event) {
questRequirements.stream()
.filter(requirement -> requirement instanceof ActionQuestRequirement<?> &&
((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass())
.forEach(requirement -> ((ActionQuestRequirement<?>) requirement).increase(event));
}```
Guys I got tons of options here
A) give up
B) spend more on experienced devs
like leafs chunk patch is pretty nicely contained
the insertions into mojang codes are as small as possible
C) Wing it and see how far you get
Have you looked into MythicMobs? It sounds like it would cover what you need. It's not open source, but that's never stopped decompilers before. :p
Custom mob behavior is difficult because people hardly do it.
still gotta spend on devs cuz i cant do all that ๐
that is the wrong mindset
I have tons of other stuff I need work on, this minecraft project is like a side project
// Note: You need to STRONGLY encapsulate your unchecked casts
@SuppressWarnings("unchecked")
private <T extends Event> void increase(T event) {
questRequirements.stream()
.filter(requirement -> requirement instanceof ActionQuestRequirement<?> &&
((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass())
.forEach(requirement -> ((ActionQuestRequirement<T>) requirement).increase(event));
}
We have custom mob behaviour with armour stands, thank you though, I am just trying to make it large scale
Who needs functionality when its fast?
exactly xD
tho leafs shit usually is rather functional
until you try to keep a minecart in a soulsand block
then shit explodes
Then I'd verify what kind of server network setup you have going on. Because that's going to determine how scalable you actually are.
XDD
Then it gets complicated. But unless you are selling oil or something I don't think you have the money needed for devs anyways. The type of devs you are searching for are few and far between
I can change it, which do you think is the best?
((ActionQuestRequirement<?>)requirement).getTriggerClass() == event.getClass(
If it didn't have the code, the cast could throw an exception, right?
Minecraft on it's way to be the most annoying possible
I have a goddamn total of 97+ tabs of github open, multiple intelli projects, trying to figure out how to register a fucking block to the block registry
Its fucking FROZEN
Chrome?
opera gx struggling with 2 tabs ๐
That isn't exactly up to me as your project sort of dictates that. If you need each server to be synchronized for certain reasons, then it is what it is. However, if you have one server that you are just copying from, then it changes how you can look at it.
It just depends on what you need. What's the server like? Is it a survival world that needs to be synchronized? Or is it something else?
edge being the champ and running all of my tabs
Nothing a little bit of a Unsafe can't fix
Nah I am deep in NMS
I am past the point of unsafe
I mean sun Unsafe
Yes, it's survival, it's basically like modded minecraft, but I want you to just join and play and feel like you are playing minecraft 2, with 500 other people
Unsafe rn lookin real safe
Not working either
Just unset the freeze flag through the unsafe
if the registry is frozen then it literally deletes the hashmap
Then freeze it again after your modifications
If not, apply the modifications directly to the hashmap or copy the hashmap in interim
Please something is not making sense
Error dispatching event PostLoginEvent(player=Alexito2060) to listener dev.alex.net.invites.bungee.listener.UserListener@3add81c4
java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap') at org.bson.Document.getInteger(Document.java:243)
If it's absolutely essential that the map is synchronized across all servers, then you'll need other systems to handle other logic like the mob spawning. Similar to what 7smile7 said back at the start.
This gets called earlier than I can change it
I usually try to keep type safety with a Map<Class<?>, Something<?>> where something has to provide its generic as a class.
So
void <T> register(Something<T> something) {
Class<T> typeClass = something.getTypeClass();
this.map.put(typeClass, something);
}
void <T> consume(T event) {
// This cast is fine because all map mutations are strictly monitored
Something<T> something = (Something<T>) this.map.get(event.getClass());
something.consumer(event);
}
This way i keep O(1) time complexity and im relative safe (as long as i strongly encapsulate the map).
But you are staying safe by iterating through all elements and checking for your type on each one, which is also fine.
And here is the actual issue
the exception is thrown due to freezing, and I can't do shit about that
That is false.
I mean I can just do a bit of funki reflection magic
I personally would just obtain the underlying data structure directly (through reflection or unsafe) and modify it without going through NMS
I am already using so much reflection and NMS
Well that is obvious
almost similar methods so
why didn't I just use PDC ๐
You can reduce the amount of mojmap hackery needed by using ASM to resolve field names and stuff, but that is a whole other can of worms
also I can't really get the fields by reflection
since md's remapper plugin doesn't remap that
so I am just using types for now lmao
Hence ASM
I.. I just wanted to texture a block lmao, welp ASM it is babiiiiiiiiiiiiiiiiiii
I have no clue how to use ASM tbh
get the bytecode for class X, then scan for what could probably be that field (i.e. do it via field accesses or something)
Class literally be looking like this, I need the first nullable
I guess I can just scan until I find the first map w/ nullable
On the other hand I could probably port Starloader's @ReobfuscateReference to md's remapper plugin
Is it worth switching to paper? Is it even that much more preformant?
if you can that'd be amazing lmao, I would really need that lol
Two questions. Both can be argued for/against.
Would you care to share some of the pros and cons?
I personally think paper is a cool piece of software
I unfortunately need to go to bed right now, but feel free to ping me in a few minutes so I'll be remembered to work on it as soon as I get back home tomorrow
I could try to do it myself tbh, mind if I try?
Feel free to
I just really need to use nms, and it seems very hard to get working with paper
Only thing is that the remapper plugin already remaps strings
just not in reflection access
But I dont know if spigots preformance will be enough for my project
not in reflection access when assigning the result to a field*
What are you trying to do?
Yeah you need to know the field name, field descriptor and the owner name when remapping
I am making fighter jets. Lots of entities. Something like 216. that needs to be updated every tick
You can make a fighter jet with just one single entity and a resourcepack
I am aware, but I am doing it the hard way. On purpose
It actually already remaps
there is just a bug when you assign the value it just doesn't
You can make them packet based. Im assuming that you are using FallingBlocks which are structured like a jet?
nonsense. If it works for read it works for write too
Yes, but they are inside minecarts. I need to rotate the minecarts pitch and yaw.
Regarding NMS i find paper much more convenient.
With paperweight?
Yes
getDeclaredField("asdasd") works
var a = getDeclaredField("asasdad") doesn't
remembered reading a couple threads about it
should still be open wait
I cant even manage to get started. I am getting an error just trying to build the thing
I myself use (or similar)
@StarplaneReobfuscateReference
@NotNull
public static String spaceDrawMethod = "snoddasmannen/galimulator/Space.draw(Lsnoddasmannen/galimulator/rendersystem/RenderCache;)V";
to remap obfuscated references, is much more reliable than inferring from context
yeah
I also have another version of that annotation lying around that is superior to that format, but I don't think it managed to get out of the draft phase due to the surrounding project being canned
Go to sleep you need to be up in about 7h
Thankfully not quite
The german education system is broke so the first 4 hours are cancelled. Hence I'd only need to get up at 9am
try {
if (UNREGISTERED_INTRUSIVE_HOLDERS.get(BuiltInRegistries.BLOCK) == null) {
UNREGISTERED_INTRUSIVE_HOLDERS.set(BuiltInRegistries.BLOCK, new IdentityHashMap<>());
}
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
Registry.register(BuiltInRegistries.BLOCK, id, block);
```Yeah it's just fucking with me at this point
Still crashes
lul
private java.util.Map net.minecraft.core.RegistryMaterials.m the field is also correct
The third and fourth hour are always irrelevant, however this time I got lucky and the first and second hours are gone too
I feel like at this point it'd be easier to write a paper fork
I mean I am doing this for work, and they want to use paper
Using a Mixin framework such as ignite is the other alternative here
If I send y'all this code that chatgpt just wrote can you tell me if it's actually gonna work or if it'll screw me over
I have no idea how to do this stuff
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class DropTools extends JavaPlugin implements Listener {
private Map<UUID, Long> dropTimestamps = new HashMap<>();
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onDrop(PlayerDropItemEvent event) {
Player player = event.getPlayer();
UUID playerId = player.getUniqueId();
Long lastDropTimestamp = dropTimestamps.get(playerId);
if (lastDropTimestamp == null || System.currentTimeMillis() - lastDropTimestamp > 10000) {
event.setCancelled(true);
} else {
dropTimestamps.remove(playerId);
}
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
return false;
}
Player player = (Player) sender;
UUID playerId = player.getUniqueId();
dropTimestamps.put(playerId, System.currentTimeMillis());
return true;
}
}
The onCommand method may be invalid but otherwise it is good enough I guess?
It depends on what you want to achieve
I just want players to not be able to drop tools unless they enter /droptools at which point they can for 10 seconds. Just to prevent accidental drops into the void
yeah chatgpt really has no awareness of what it's doing huh
I couldn't tell the difference if it did๐ I've looked for an already made plugin for this and couldn't find one so I turned to chatgpt
not suprising
IT WORKED
But not quite
Now I just need to make it send the proper block
and bim bam boom I'll be a happi boi
casually softlocked a chunk area
And now you suddenly see that you can't just add a block to a registry willy-nilly without the protocol overreacting at the same time
I was already aware
I finally managed to add it to the registry
I now need to do the other 50%
I was honestly shocked this plugin didn't already exist
Hi, how would I make a mute command/code to mute people based off their UUIDs in the chat for x time?
Is there a Spigot Mapping -> Mojang Mapping tool?
?nms
Doing this already
Persistent and easy way -> Add a Scoreboard tag or write a tag into the PersistentDataContainer
Then listen for the chat event and cancel it depending on this data
then screamingsandles web site
How would I do this? Brand new to MC plugin stuff lmao, coming from TypeScript stuff
Done some Kotlin tho
what do I do there
it has every mapping
Here are several tutorials on how to create a simple plugin
https://www.spigotmc.org/wiki/spigot-plugin-development/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
is that whole chapter two of the bible in the lore?
I recommend this one if you know what a build tool is
Otherwise this one
After that you pretty much only need to know those three
man doesnt like gradle
cries in fabric
Is there a good tutorial out there that explains how to create advanced holograms? By advanced I mean that we can easily edit the file, destroy/respawn the hologram if needed etc. There's none out there
Interesting, I might consider making one. Btw there are some really well written hologram APIs out there.
Yes I'm considering using them. But then my users would have to download that plugin aswell
Som1 know why my getTitle doesnt work ?
https://paste.md-5.net/ewifenepem.java
What's the EntityInsentient class from NMS, and what it does?
you shouldnt check inventories by title
Inventories dont have titles anymore. Only the InventoryView which is currently viewed by a player does
And that
keep an instance of the inventory and check if that inventory is the same
Or a Set<Inventory> if you have multiple of that type
yeah
is this good ?
yeah
If 2 people open the inventory then the first one will break
its opened by the command /fdescc
is this going to work ?
its not a chest
If 2 people open the inventory then the first one will break
How i fix that ?
Use a Set<Inventory> and check for contains or only create the inventory once in the constructor
okk
The former method also requires you to remove the inv from the set in the InventoryCloseEvent
Dont check inventory by title, u should either use inventory holder or compare inventory object
?stash
?
How do you serialize UUIDs with Gson?
I already created a type adapter for it, but its throwing an exception
String or 128bit int
Show the adapter
Looks good. What is the exception?
java.lang.UnsupportedOperationException: JsonObject
at com.google.gson.JsonElement.getAsString(JsonElement.java:191)
at dev.alex.net.inviter.bungee.adapters.UUIDAdapter.deserialize(UUIDAdapter.java:17)
at dev.alex.net.inviter.bungee.adapters.UUIDAdapter.deserialize(UUIDAdapter.java:8)
Basically is expecting a JsonObject but i dont find the cause
Your data is malformed. Make sure you delete the data before retrying.
Maybe is caused because i have a uuid field on custom, which then im serializing with Gson#toJson() and Gson#fromJson() ? i edit it
Wait how are you using your type adapter?
Does the specialsource-maven-plugin already work for 1.19.3 ?
Looks like it has problems with java 19
I register it thru Gson builder, and create a Gson instance which im using to then doing smth like this:
class UserModel {
UUID uuid;
String name;
bla bla;
}
Gson gson = GsonBuilder.
UserModel user = new Usermodel(bla, bla);
String userData = gson.toJson(user);
UserModel serialized = gson.fromJson(userData, UserModel.class);
Im thinking the issue came when trying to seriliaze/deserialize the UUID using it as a field inside a custom object
Where do you register your type adapter?
On main class
Show how pls
Serialize the data to json and show the result pls
right
1m please
Okay it doesnt even serialize it into json string
Oh wait i forgot to remove a line ๐คฆโโ๏ธ
Easiest way to store user data persistently in spigot? Is there like an example/docs example? Would be helpful :)
Hey! would anyone be able to help me with this error i'm getting with HikariCP?
?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!
I can't seem to post SS, so here's the error
?img
Not verified? Upload screenshots here: https://prnt.sc/
Oh no please, that type of url are blocked in my country
Instead tell them to get verified with their spigot acc
14.02 00:58:40 [Server] ERROR Error occurred while enabling IslandCore valpha-0.1 (Is it up to date?)
14.02 00:58:40 [Server] INFO java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
14.02 00:58:40 [Server] INFO at com.zaxxer.hikari.util.UtilityElf.createInstance(UtilityElf.java:106) ~[main-alpha-0.1.jar:?]
14.02 00:58:40 [Server] INFO at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:322) ~[main-alpha-0.1.jar:?]
Okay i'll get verified shortly
my maven setup, is this
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
Please format your code
?formatcode
?codeformat
๐ก
they remove it, it was such a nice command
Im 100 sure
I don't think there was a command like that in the first place.
i remember there was one
Yes it used to
It used to tell you how to format proepr your code
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
hehe
Ah
Could of used that earlier. lol
Sorry! does anyone have exp using HikariCP?
Just ask bro
?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!
Show some code pls
Do you shade in mysql?
Have you tried using com.mysql.cj.jdbc.MysqlDataSource instead?
Anyone know what I can use instead of ItemMeta().hasPersistentDataContainer()?
package prisonisland.main;
import org.bukkit.plugin.java.JavaPlugin;
public class IslandCore extends JavaPlugin {
private MySQLHelper sqlHelper;
@Override
public void onEnable() {
// Connect to MySQL database
sqlHelper = new MySQLHelper("jdbc:mysql:/hostprefix:3306/databaseprefix", 3306, "databaseprefix", "userprefix", "passprefix");
// Register event listener
getServer().getPluginManager().registerEvents(new PlayTimeListener(sqlHelper), this);
}
@Override
public void onDisable() {
// Disconnect from MySQL database
if (sqlHelper != null) {
sqlHelper.close();
}
}
}```
Wdym instead? The PDC is a pretty solid choice.
Cannot resolve method 'hasPersistentDataContainer' in 'ItemMeta'
To achieve what exactly?
made with java 17 or 16 iirc, should work on 1.19
NBT data in config.yml file
Oh you are using one of the ancient Spigot versions
no
Are you using 1.13 or higher?
Does it do the same thing?
getPersistentDataContainer will just return the container
has returns true or false
an item will always have a peristent data container
just tried that, didn't seem to help :/
Throw me some ideas then. Haven't been using the special sources plugin for a while.
it will always have a container, it will not always have values
dafuq?
Can't use the ! operator in getPersistentDataContainer
version 63 is java 19
different error now
14.02 01:18:38 [Server] ERROR [com.zaxxer.hikari.pool.HikariPool] HikariPool-1 - Exception during pool initialization.
14.02 01:18:38 [Server] INFO java.sql.SQLException: Malformed database URL, failed to parse the main URL sections.
14.02 01:18:38 [Server] INFO at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.27.jar:8.0.27]
get the pdc keys of the item and check if its empty
public static Map<String, NBTBase> getCustomDataTags(PersistentDataContainer container) throws IllegalAccessException, NoSuchFieldException {
Field customDataTagsField = container.getClass().getDeclaredField("customDataTags");
customDataTagsField.setAccessible(true);
return (Map<String, NBTBase>) customDataTagsField.get(container);
}
Well fix your jdbc url then...
You need a double slash in the url. jdbc:mysql://therestofyourstring
Smile this is working perfect, so must be something related to either mongo or redis
Thats what i thought
You having trouble with the special source plugin?
Yes. I think i made a mistake by building the remapped files with java 19 and then trying to use the special sources plugin which only supports up to 17
But thats just a wild guess im testing right now
thanks, but I already have that! Not sure where I'm going wrong - here's my format jdbc:mysql://hostname-IP:3306/database-name
You didn't in the example you gave though. What does your MySQLHelper class look like? It's probably not being formatted correctly there.
?paste the class please
Well... this was not it. Are you able to use it for 1.19.3 remappings?
Yes I am.
https://paste.md-5.net/fagutalaco.java thank you for taking a look
Ok but this clearly looks like the plugin cant handle v63 class files...
But where are they coming from?
Uhh, these version numbers. I hate figuring these out. Personally, I'm still using Java 16, but writing in Java 8 for the time being. However, let me install Java 19 and I'll let you know if I have issues with it.
?paste
Nothing in here looks odd to me
https://paste.md-5.net/yijodidawe.xml
Mind sharing your pom?
Yea, so currently the project I use the mappings on has several. Let me get a quick test plugin up.
Huh, I guess the special source plugin is stuck on Java 17.
Did you notice anything Shadow?
Yea, how did you change the version? Cause you could of just set the compiler version and still have the project be labeled as 19 in the intellij project settings.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>
I've changed both
Is that how it's supposed to be used?
Yes
That might explain it then. lmfao
Yes. java.version means nothing to Maven. It's just a custom property
XD
I should actually add spigot.version to clean this mess up
Ah this looks nicer ๐
Sometimes i dont completely hate maven
Yea, your input is the problem. You are setting the 'host' parameter to "hostname-IP:3306/database-name" without replacing the values.
that was placeholder text...
Well your examples aren't exactly showing a clear picture. I'm working with what you're giving me.
Where do you replace the values then?
i overtyped them before sending it through one sec i'll send the original
sorry for being a hassle!
Smile im really confused about registering the custom codec for Mongo client
I already setup a custom codec for writing and reading
Oh I think I see part of the problem. You should be using the HikariConfig to be setting the values not Properties itself.
HikariConfig#setJdbcUrl()
HikariConfig#setUsername()
HikariConfig#setPassword()
HikariConfig#addDataSourceProperty() <---- For everything else that's not included.
HikariConfig config = new HikariConfig();
// Set the config values
HikariDataSource dataSource = new HikariDataSource(config);
Properties are the one from the uri if im not wrong?
He's using java.util.Properties. There's no need to when the methods provided by HikariConfig are the correct way to set them.
for example: <method>://<user>:<pass>@<host>:<port>/db?authSource=admin
ohh right i catch you
You could also set the values on the HikariDataSource manually, but the config options make it easier.
Okay i'll try that thanks
Im gonna treat you with one of my personal classes. A MongoDB Codec which is backed by a Gson instance:
https://gist.github.com/Flo0/2f751f875b040dae23a62379443d451e
You need to create a separate codec for every MongoCollection<V>
// Very important to pass a good Gson instance here
public TypedGsonMongoCodec(Class<V> typeClass, Gson gson) {
this.typeClass = typeClass;
this.gson = gson;
}
Example:
MongoCollection<V> mongoBackbone = ...;
CodecRegistry customReg = CodecRegistries.fromCodecs(new TypedGsonMongoCodec<>(mongoBackbone.getDocumentClass(), gson));
CodecRegistry codec = CodecRegistries.fromRegistries(MongoClientSettings.getDefaultCodecRegistry(), customReg);
mongoBackbone = mongoBackbone.withCodecRegistry(codec);
The codec basically translates json to bson and back.
And Object -> json / json -> Object is handled by Gson
Hey 7smile, was there a reason you needed Java 19? Or are you just trying to stay on the bleeding edge?
Im using this so that i can use MongoDB like an actual Map<K, V> ๐ (With long get/put operations)
Was just trying out some of the newer features
Oh really thanks man!! I will try implementing it
is loom out in java 19 ?
Isnt that scheduled for the next LTS?
Idk, I'm asking
what came in j19
Does anyone know of a plugin to generate a world of plots for 1.19?
I remember seeing it for 19,but I see no hype for it, so probably next lts as you say
PlotSquared
sadly instanceof pattern matching is only experimental 
whats instanceof pattern matching
19 mainly consists of incubations + RiscV port
I search but it says until 1.14
if (value instanceof String string)
i thought that was j16 or 17
still nothing ๐ญ
So then you have something like this, right?
MongoDatabase database = client.getDatabase("testing").withCodec();
MongoCollection<MyObject> objects = database.getCollection("collection", MyObject.class);
Unless smile was referring to switch instanceof pattern matching
this one
In which case identical concept, but for switch cases
oh fun
What's your code look like now?
does spigot change java version with mojank
switch (value) {
case Integer i && i > 10 -> /*whatever*/
}```
CraftBukkit jumps because it directly compiles against server internals and has no choice, but Bukkit stays compiled against 8. You can compile your project against 8 or higher
is that a new thing?
im not sure you can do it yet
It's been in incubation/preview for like 4 major versions
Probably J20
but who knows at this point
oh awesome
Animal animal = something;
switch(animal) {
case Cat cat -> cat.pur();
case Dog dog -> dog.bark();
default -> animal.doSomething();
}
Something like this
syntax looks a bit funny
override fun register(listener: Any) {
listeners.add(
when (listener) {
is PteroEventListener, is ClientSocketListener -> listener
else -> throw IllegalArgumentException("Wrong implementation of listener !")
}
)
}
Kotlin ๐ฅต
kotlin ๐คฎ
Hey wait, hold up. The is keyword. That would be a nice replacement for instanceof if you ask me.
definetelly more human readable
'is' is pretty ambiguous
if (listener is EventListener)
how is it ambiguous ๐ค
what can it mean
aside from instanceof
implements > instanceof ๐ช ๐ค ๐ฅ
if (value implements Something) {
}```
So I have this little code here :
HashMap<int, ArmorStand> holograms = new HashMap<>();
ArmorStand hologram = (ArmoStand) location.getWorld().spawnEntity(location, EntityType.ARMOR_STAND);
holograms.put(1, hologram);
And I'd like to delete the armor stand at the key 1. How can I do this?
I tried this, but it doesn't work:
holograms.get(1).remove();
if(a is b)
holograms.remove(1)
I could get behind this.
but i feel sorry for those people ๐ญ
it uses key value pair not index
Maps aren't random accessible nor indexible
no holograms is a hashmap
also you can't have primitive
yes?
in hashmap
hashmap has .remove(key)
use Integer instend of int
I want to delete the armor stand (not remove it from my hashmap)
will deleting it from the hashmap actually remove it?
by "remove" do you mean from the world or from the hashmap
does those ints represent index or something other
No, you have to call #remove on the entity itself.
oh i assumed they are talking that its Integer lol
Yeah sure. I just wanted an easy key because the actual one is a location and yeah I don't want to add stuff to that snippet to explain that I know how to get the right key
.remove() on the entity should work
How did you remove it?
pretty much this
oohh wait
I think I'm dumb
Is there another free plugin? The dollars here are expensive.
ok it works now
Had a problem with my key (was deleting it right before I try to access it)
Oh wow. I've had it for so long that I forgot it was premium. lol
I remember the outdated ones like PlotMe or PlotManager, but I don't know if many other more modern ones even exist. PlotSquared kinda took over that niche.
If I buy the plugin are the updates free?
I will trust the developer.
PS: I don't even know how they understand this translator, I don't know English
Hello guys, is there a way I can let my players choose what texture pack they want, between the dark and light theme, and then it automatically puts the texture pack on
save their choice somewhere then when they load in use a diff url
Yes, how do I send the texture pack to the user?
declaration: package: org.bukkit.entity, interface: Player
That is like the server properties file? It will automatically load the texture pack?
You know, how if I set the URL in the server.properties, and if they have resourcepacks enabled, it loads the texture pack
Does that function load the texture pack
the method has nothing to do with server.properties
I don't think it's possible to load different ressource packs for each user
the only way I see it possible is if you connect them to a different proxy and manage to get them on the same world
I never said it did