#help-development
1 messages · Page 1005 of 1
you dont get mixins on spigot
Right
Nms isn’t spigot tho
That being said, I still have only ever used spigot so the point stands
i don't have mixins, but i have server patches
mixins
i use win32 to open a native os window that replaces the running minecraft session
If paper is so good then why doesn't it have mixins!
basically a runtime patch
How does that work? Is it kinda like hot swapping?
would assume so, hot swapping is with shared libraries iirc
bytecode transformers maybe
It's a fancy ASM wrapper essentially
I haven’t really looked into it, but I’d assume it’s the same as this? I’m not so sure
I mean yes
youre both right
its a mapping from obfuscated code to code someone can read
Ah that makes sense
it means to map it again or to something else
Obfuscated -> into actual readable values then I guess
what time is it
depends on how you look at it
9:16 a
ty
you could consider mapped code to be a remapping of the obfuscated code
but thats just grammar
That’s uh whatever Alaska’s time zone is
ty
Sure!
wdym
its not that difficult
there is garbled code and some way to ungarble it based on what someone said it should be
yes
its remapped into mojang
it means its mapped like mojang code
Remapping means that you map something that is default into something else. For example if you press "A" you get "A". But if you remap it, you reconfigure it for example so that when you press "A" you get "F".
So "remapped Mojang" means that you have default Mojang things - which have been remapped.
no, you wouldnt remap it to be obfuscated
that would be stupid
then compile it
and obfuscate it
then its not your code to distribute
you can distribute plugins/mods using mojang mapped classes/fields, what you cannot distribute is the mappings file itself, or any "substantial portion" of mojang's own code (this is regardless of mappings)
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
but, yada yada IANAL perform at your own risk
hi, I need to detect changes in inventory, what event should I use? I want to be able to detect all changes, even these made by setItem() and addItem().
Yada, yada, WHAT-
hashcode() iirc
Also, I tried to do adapter class but open inventory method requires nms inventory
"I am not a lawyer"
Just a bit of an unfortunate abbreviation lol
You say unfortunate I say beautiful
Choco says unfortunate, coll says beautiful, I say fortuitous circumstance
Choco says unfortunate, coll says beautiful, NuclearKat say fortuitous circumstance, I say ok bro
what happens if alex says that
I'm having terrible trouble accessing ServerboundClientInformationPacket with ProtocolLib.
What part are you having problems with
private void registerHatDetector() {
protocolManager.addPacketListener(new PacketAdapter(
this,
ListenerPriority.NORMAL,
List.of(PacketType.Play.Client.SETTINGS)
) {
@Override
public void onPacketReceiving(PacketEvent event) {
var packet = event.getPacket();
var packetType = event.getPacketType();
if (packetType == PacketType.Play.Client.SETTINGS) {
This works fine.
But everything after this is just .. I'm not getting the data.
So basically:
var data1 = packet.getByteArrays().read(0);
System.out.println("Data: " + data1);
Tried with arrays, with bytes, with integers ..
Everything throws.
So the listener is working fine?
Yes.
but you're having problems reading
What data are you looking for
Right at the end, this is the data I need:
[Netty Epoll Server IO #1/ERROR]: Parameters:
net.minecraft.network.protocol.common.ServerboundClientInformationPacket@5209fdf0[
b=ClientInformation[language=fi_fi, viewDistance=16, chatVisibility=FULL, chatColors=true, modelCustomisation=126, mainHand=RIGHT, textFilteringEnabled=true, allowsListing=true]
]
What do you want to read
Especially the "modelCustomisation"
Which holds the data whether the player has hat enabled/disabled, etc.
Ie. in their skin.
This is the docs for the packet.
I don't know what I'm doing wrong.
Let me give it a try
Packet: PacketContainer[type=SETTINGS[class=ServerboundClientInformationPacket, id=10], structureModifier=StructureModifier[fieldType=class java.lang.Object, data=[com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor@fb3455b]]]
Do I need to use getModifier?
😢
Hello chat weird question, does anyone know where the code for the console's line input is in?
Sorry for the wait I had some other stuff to do. As you can see in that error message the packet contains a single object. That object is the ClientInformation record which then contains the data you want. You can see this by looking using a debugger or just looking at the nms code (see attached image). So what you need to do is read the client info and then read the skin parts.
This would look something like this;
PacketContainer packet = event.getPacket();
StructureModifier<InternalStructure> objects = packet.getStructures();
InternalStructure clientInfo = objects.read(0);
int skin = clientInfo.getIntegers().read(1);
BitSet bitSet = BitSet.valueOf(new long[]{skin});
boolean hasHat = bitSet.get(6);
Bukkit.broadcastMessage("Has hat: " + hasHat);
🤔
Feel free to replace that bitset with bitwise operations if you want
Ok, I'll try it out.
I swear a lot of people seem to have this issue
I think something about updating intelij
Idk
it does not
You can use Toolbox to handle updates
It works. Thank you so much for your help. I still have no idea what's going on with the goofy code. But, IMO, it just seems ProtocolLib is really badly designed. It shouldn't be this difficult.
It's just a layer of reflection
if you want something easier to work with checkout PacketEvents
Well, to be fair I don't really know any Java. I'm more familiar with C#.
It is a bit hard to work with if you don't understand the internal structure of things
so uh i got abunch of text displays, about 30 but for whatever reason the specific 8 of them always just go poof by themself, i look at them and they suddenly dont exist (it happened twice on the same 8 text displays and the others didnt disappear), what could be causing it? i looked at every class in my plugin and nothing messes with non living entities
i tried using external hologram plugins but they're all packet based and can't be scaled with axiom (block and display entities editing mod), i tried making my own but they still die somehow (i had anti death mechanics)
are they set to persist?
yes
and you set remove when far away to false?
they dont have that in their nbt so im guessing thats for giants only
True is the default
unless you have a plugin removing them
i prob have one but i cant tell which one it is
Thats a You problem then 😦
dev on a clean server
it takes literal days to happen
i wish there was an EntityDeleteEvent or smth
wait what if i just listen for DEATH cause in EntityRemoveEvent
ah fuck it isn't cancellable
Just listen for anything other than the unload reason
and the despawn
You could use the current thread stacktrace to find where it comes from
and log it to your own file so you can get a history
where is that
should i "respawn" the text display when it gets removed from PLUGIN or DEATH?
And then telling the author of said plugin to git gud
Idk this is why I normally opt for non-persistent hologram entities
And just spawn them on chunk load
these cant be scaled with axiom
and i don't want to go through the pain of using numbers
What
this thing
The heck is that
a mod
Why is that relevant to spawning them on chunk load
https://modrinth.com/mod/axiom seems cool
because theyre stored in a variable, usually just the transformation and the display
and if i try to edit it with axiom, in the next chunk reload it'll reset
it is royally pissing it down outside and i can hear the rain through my headphones
save the data on the server?
Axiom is pretty sick. The people writing that mod are awesome
moulberry does make cool stuff
I don’t understand why you need axiom to scale it
Scale is just a simple vector, no quaternion magic
but math is hard !!!!
i wouldn't like to mess with numbers 30 itmes
I dropped out in 2nd grade
so thats why your here
touche
Epic did the same
gotta learn the math somewhere
That’s why he never uses the right you’re
i do sometimes
Just make a command to set the size and play around with that until you’re happy with it
Or hotswap, kek
you learnt how to hotswap all by urself didnt you
That was never a proper solution
that was
Especially since it’s not cancellable on spigot, kek
its much easier to just find out whats removing them
I assure you they don’t die of old age, so something is explicitly doing it
how do i get the server stacktrace thingi
a thread dump?
You can also just do Thread.currentThread.something
that gets everything?
Thread.dumpStack() moment
should i broadcast it or will i regret it
log to file
nah ill broadcast it
Depends how often display entities get ded on your server
try to stop me >:)
its a huge text
my server has seen worse
"oh i cant read it, why didnt anyone stop me"
Well it’ll be in the server logs
besides the point
Yes but it gives you the call stack
it's tiny and doesn't have anything related to entities tho
both do. the dump does it to the error stream, the one I posted gives you a String you can use
Where did you put it? 
Ideally you put it somewhere that's triggered when your entity is removed and not somewhere totally unrelated
Yes
You do it IN the event where you die/remove
Yeah but your dump stack should be in like an entity remove event or something if you don't know how it's getting removed
ye
im gonna bet 5 chocolate bars it's not gonna disappear now that i want it to disappear
No of course
act like it never happened
Now that you're trying to fix it, it's gonna scurry and hide
exactly
One day someone will /kill all the display entities and the console will explode
But shhh, that’s their problem
oh wait how would i get the stack if it's just doing printStackTrace
the stack trace is the stack
?
ur telling me to add it to my custom log file
yes
You want something more like this then
sure
StringUtils.join accepts a String array
its an Apache lib
ah
can't you just do new Throwable().printStackTrace(); to print one?
or even better is Thread.dumpStack(); or smth
you can, but you get a String array
printStackTrace prints a string array?
it just depends if you want to log it and how readable you want it
I don’t think it is anymore
but String#join() accepts varargs. I dunno why you want to use Apache Commons so badly
I guess technically it takes a CharSequence varargs but that should be fine lol
Even better
Im making a plugin for 1.18 - 1.20 and there is some small differences in the code in each version, how can i setup my project so i can work on multiple versions?
And how can i test the plugin in multiple versions quickly, idk if i can make a server for every single version :/
Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...
add
AHHHH, all the System.exit() calls are catching up to me.
I've been chasing my tail trying to figure out why things weren't working.
Can anyone recommend a good forum/docs to read up on creating animation sequences?
What are you System.exit()ing in
Is there runPaper for maven?
run WHAT?!
runPaper
?whereami
Emily about to have a stroke in the Spigotcord
You signed that document that says we are not personally liable for heart attacks, correct?
The spigord
That just sounds like we're a pumpkin
Wait you guys aren’t pumpkins?

ok so https://www.spigotmc.org/threads/rule-changes-re-obfuscation.420747/ says "Free resources may only use basic name obfuscation"
So does this mean all the things mentioned inside (e.g. no string obf & stuff) is disallowed only for free resources? Or can i use a better obfuscator in a premium resource
We'd rather your strings not be obfuscated at all
And, really, string obfuscation provides you no true benefit anyways so
Does any obfuscation really provide significant benefit
Vulkan should be taken down then. They use ZKM, which is completely unreadable.
They may have gotten an exception. Unsure
Especially because it's an anti cheat I'm inclined to believe that that is the case
Oh, well, lol
the only real strings in it are like "reload" and stuff
it's not actually
I meant Vulkan, the one that uses ZKM
i mean i was just gonna use j2cc because it's quite good but like...
you can only use obfuscators on the list https://www.spigotmc.org/threads/approved-obfuscators.420746/
cringe
Md got hit with the cringe
bruh
Oof
?ban
Gn bro... you got cringed
would a trash can gui esque command be as simple as calling Bukkit.createInventory() n then just letting the player plop items into it
Ye
poggers
Hey there, I know in an older April Fools version of Minecraft they implemented different colors for Nether Portals, was this feature kept in the newer versions? If so what is needed to actually adjust this?
no why would it
people would've done that if it would still be in the game
I wasn't too sure - I've been out of the loop for quite a while so I wasn't sure.
?
just make a script to read all the block models
because i doubt you can do that as it's rendered by the client's resource pack
is this an acceptable way of using one MongoClient from my main file in spigot
public class PlayerHandler implements Listener {
private final MongoClient mongoClient;
// init ID
private int taskID;
// now we gotta have our plugin connection don't we c:
public PlayerHandler(Prisons plugin, MongoClient mongoClient) {
// mongodb stuffs
this.mongoClient = mongoClient;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void displayScoreboard(PlayerJoinEvent event, Document playerProfile) {
// mongoClient tings
createBoard(event.getPlayer(), playerProfile);
start(event.getPlayer());
}
// more tings and shtuff
}
thats not how Listeners work
Do not ignore errors your IDE is showing you
actually, that won;t show as an error
I guess I'm having an issue understanding how to put documents from my mongoclient in different classes under the same MongoClient
but its wrong
what's the reason you have a taskID in your listener?
you can;t pass anything other than the event in a Listener
I like self registering Listeners but I don;t do it as it's bad in principle
it's best practice to some, but I don't feel like that way
i'm using it for my scoreboard in start(Player player)
how should I be passing my MongoClient into my handler? or can I not?
could you show us the entire class so I can get a better grasp of what you are attempting to accomplish?
you get it where you need it, you don't pass it
The act in itself is probably not an issue, the problem lies in how it is being used
sure sorry give me a sec, I'm a bit new to this language/spigot so sry ab that
passing yoru client in the constructor is fine
remove teh Document from the Listener
I haven't actually done anything with it since I wanted to learn how to get the same client in first.. my first try I was using a separate client every time the event occured which was just pure shit performance, I may just initialize the client in the constructor
thanks for your patience with me lol
is getting my collections in the constructor fine as well?
scratch that
don't mean to be annoying but how about this
@EventHandler
public void displayScoreboard(PlayerJoinEvent event) {
Document playerProfile =
playerProfiles.find(Filters.eq("UUID", event.getPlayer().getUniqueId())).first();
createBoard(event.getPlayer(), playerProfile);
start(event.getPlayer());
}
yep
great thanks
doesn't this cause issues with performance?
it will
ok
Wrap code into Async and call it a day
anyone know how I would store custom plant values in mysql?
plant?
you can use a Text data type and store json/base64 in there
and then serialize/deserialize
wdum store a plant
?xy
wll locations of a plant
if it's an actual plant you can store the material
then store locations
im trying to make a custom plant
then store locations not the plant itself
a custom plant out of what?
but how would get help of mysql to do it
you can (de)serialize the location object and save it
I don't know what I'm even doing
Why do you feel you need to use SQL at all?
true just use yml files
because if a plant is still growing I want it to save even when the server restarts or a player rejoins
if you load yml files with bukkits loader u can just do file.setLocation
what block are you going to use for the "plant"?
theres other saving methods than databases
melon
well you should definitely use yml files instead
or other files
but not a database
well what if like many players have loads of farms wouldn't that yml file be pretty long?
so? lol
what size are we talking
a few hundred lines? a few thousand? a few tens of thousands
idk, but how would I use yml files then?
probably make a wrapper for it first
What are you making? Minecraft already has these futures.
just go with a custom flatfile file format :p
or use block pdc
just a warning, I am very stupid and I am a beginner
so I don't know what yall are talking about
we know
thats why you need to tell us what you are trying to do
like actually trying to do
?xy
as a beginner I'd pick somethign simpler to start
I'm talking about the legendary - the one and only: DATA OUTPUT STREAAAAAAAAM
ByteBuffer: 🗿
?configs I'd just go yml
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
yep
no. I want to try something difficult
but that doesnt make it better
lol
sure
burn your data in cds
Oh in that case use https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/channels/FileChannel.html#map(java.nio.channels.FileChannel.MapMode,long,long) which would be the most robust solution out there but good luck storing strings there
A melon is probably not a good crop to use as it ends up placing a block in its final stage
which is why you should use yml. Its the best solution here
hard != better
best being relative
okay how do I implement it 😭
.
In my bukkit plugin dev days I used to do quite a few PRs where I would yeet out .yml based configurations in favour of ByteBuffer/DataOutputStream solutions
thats only for certain scale though lol
I'm a fan of low-level optimizations
I saved few bytes with bytebuffer yepiee
im 100% certain theres methods in your code that could with a 1 line fix save more resources than that
There are in every code lol
1 line fix? That is rather ambitious as that would usually be only memory management issues
well that is cheating
wdum cheating lmao
because that requires knowledge of algos I don't have at any given point in time
e.g. if you alter the library I use for voronoi gen then it is pretty obvious you'll get better performance
Same goes for QuadTrees or all other things that are a bit beyond me
you can optimize alot of stuff just by simple logic
99% of optimisation (that actually does any impact) is done by rewriting methods differently
have you ever tried to follow a data oriented design then?
like infrastructure-wise almost
conclubuwu when r u gonna boost me in valorant
lol dou even play anymore
sometimes yh
well in that case lmk and we can play :]
idk, most of the performance improvements I've seen are memory related (don't use List if you are going to call #contains on a list of 1M elements or actually cache the results of expensive computations)
I - don't exactly know what that buzzword is supposed to mean
tbf I think thats a really common optimization
well you know how OOP often in results in poor data locality
yeah if done wrongly
which happens surprisingly quick
ah, so basically the ECS approach?
yeah
well more generally than just that, but thats a part of it
it happens often, even if done less wrongly
thats why we should all start writing our code in 1 class
who needs classes anyways
from time to time I try to do it, but it doesn't happen super often I suppose
well u compromise on maintainability, reusability and readability then arguably a bit too much
ah, but ive seen you implement your own data structures relatively frequently
i dont know how :c
maybe im already doing it a bit
never learned it propperly
yeah, that is because I randomly decide to hyper-optimize a piece of code for maximum throughput
Refactored the entirety of discord2fa yesterday
60 files changed
i heard the word ecs
lol
Speaking of data structures: I've always wanted to make a plugin that would store all it's persistent data in a MappedByteBuffer, but I never got around doing this. Storing strings in there in a way that is efficent is surprisingly difficult
yeah, fragmentation/indexing
Plus you get issues once you want to actually remove data. It might be good if you need some kind of ring buffer (logs?) or store data that can't/shouldn't be removed (logs), but outside of that I've yet to find a good use for it
but yea also the new module export/import feature is gonna be lit
module?
did i miss something?
oh god
pretty ass
is that meant for people who write imports theirselves?
wow
I mean, what is the actual difference to a wildcard import
beyond only importing exported types
so one could do import module java.base? \🤔
it's still going to break if names change or whatever
not that importing is an issue for anyone but people writing in notepad either 
I can;t see much of a usecase
Less work for the compiler <3
Eclipse Ctrl + Shift + O keybind is the best
Feels like a "you have to write this on paper in an exam? There yo go" JEP 
imagine even having to press a keybind, cringe
completely useless for any normal developer 
well eclipse will auto-import too, but the organizing imports keybind can do much more than just import needed classes: It will reorder them correctly, will separate related imports, etc.
basically replacing .* with module
It can even automatically import static methods!
damn
i press ctrl + alt + l and it formats my whole file including everything you said
I just press CTRL S for that
i press <space>fd in neovim for that \💀
Well I can do Ctrl + A, Ctrl + Shift + F if I wanted that, but I never do that because it breaks my very special line wrapping
same
editorconfig file?
I do CTRL + SHIFT + F on select code
I don;t always format things the same, for readability
I could also configure eclipse to automatically format on saving, but that I only do if I want to kill the performance of the IDE
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 65
is your server running with java 21
or well, share more of the error/whats the context
?paste
Can someone tell me how to start the travel task when a player join so they get the effects even if they leave adn rejoin I know my code is very messy and bad but I just want to know hoe to start the task for the player on join thanks. https://paste.md-5.net/ifigamufak.cs
im running run-task plugin of intellij
it should be
can you share your build script
Hey,
I am trying to display a simple string under the players name and i cannot figure out how to make it work properly on all versions
I've seen that there are ScoreFormats ore something like that that removes the number in front of the string displayed below the name.
But that only works for 1.20.4 clients i've tried using a 1.20.4 server with via version but that doesn't work.
If i am using scoreboards and displayes it still displays the number and i don't want that tbh
I've also tried using a packet api for that but that didn't worked either.
So i am thinking of entities like armor stands or something but that would probably cause massive performance issues in the future so i hope there is another solution for that.
Any help is much appreciated
have you tried display entities as passengers on the player
you can have a y-translation to specify the height coordinate
How far back do you want to go
1.19 i think
Because display entities are 1.19.4+
so you mean i could display a textdisplay for 1.20?
Yes
tried not exactly as i said i think it would cause massive performance issues in the future
that's how many servers (e.g. mcc island) do it too, but it really shouldn't cause perf issues as it's just a fancy text component
alright i will try that
They don’t tick
but i need to update them
just do it on-demand
With 100 players you’d have 100 display entities so that’s basically nothing
so i just spawn them new when the string changes inside a database for example?
no, change the text
Not ticking just means they don’t run any logic every tick
say you have a Map<UUID, TextDisplay> you just edit the text component
They still respond to updates
and how should i handle the normal name tags?
i mean if i want the string to be below the player name then it would be inside the player if do it below the vanilla height of the vanilla nametage?
translations
/transformations
where you can have e.g. a y-translation of 0.15f, you'll just have to figure out the magic digits
agreed
e.g. i just have something like this
val textDisplay = world.spawnEntity(player.location, EntityType.TEXT_DISPLAY) as TextDisplay
textDisplay.text(nameTag)
val transformation = textDisplay.transformation
transformation.translation.add(0f, 1f, 0f)
textDisplay.transformation = transformation
textDisplay.billboard = Display.Billboard.CENTER
player.nameTagDisplay = textDisplay
player.addPassenger(textDisplay)
Hello, with Player#spawnParticle, the particle spawned is only visible for the player ?
yes
can i just place the normal name tag higher?
Yes
okay thank you
no
or do i need to disable it and create it with a text display?
yes
using scoreboard teams you can hide em
okay and how do i disable the vanilla ones?
team option
Ye, add them to a team, and disable name tag visibility
Hello, how can I create a colored particle for spigot under 1.13 ?
Packets
uh
nms my beloved
okay...
check out https://wiki.vg/Protocol
yeah for sure
this should totally be a command btw
x)
oh perfect thanks
because ParticleAPI is a bit heavy, so I want to lightweight a bit my plugin
and I'll get more knowledge by doing that
Then your plugin is version dependent tho
no problem
they are already in a team because of my tablist system
so i just disable it for all the teams i use in the tablist?
NMS changes across version alot
I know
yes
but I only need to make from 1.9 to 1.12.2
Then you need diff reflections for each version
yeah
but mfnalex is here with his great tutorial(s)
thanks for the help @blazing ocean, @young knoll, @vast ledge
no need for the ping lol
SORRY
x)
iirc you need TeleportFlag#RETAIN_PASSENGERS for every teleport tho
which doesn't work across worlds
or was that paper
i mean if just set it as a passanger i dont need to teleport it or do i?
teleporting the player with passengers returns false without it
lemme just quickly check if it's only a paper thing because i had that issue
?jd-s
i am using FoliaMC ik its basically paper but with better performance but could that lead to the error also?
might work not sure
alright i am trying it
you should switch to paper discord for that
i just edit paper to always include that flag
i was there already
i've tried to get help there
but i got ignored there thats why i am here
it is just paper
can you tell me how?
https://github.com/papermc/paperweight-examples but this is really out of scope for spigotmc discord
doubt they'd benefit from forking paper 
yeah it just depends on your usecase
yea i know sorry
Folia is a bit more than just paper but better performance
yeah
*tiny bit 
can you share the whole build output
I wanna say you are just failing at shadow plugin
but the one line you posted isn'T really enough to conclude that
maybe because its not updated?
Well yea, you need to switch to the fork
idk what you mean its just paper with better performance
link?
goober
alright i got it spawning and set it as passanger to the player but 1. it doesnt rotate with the player 2. i cant get it to out of the player model with the transformation
Set the billboard to vertical to have it rotate
alright thats working now
You 100% can get it out of the player model with the transformation
You can basically put it anywhere
even if its a passenger?
Yes
then i am just to stupid to get it work lol
Show code
TextDisplay textDisplay = player.getWorld().spawn(player.getLocation(), TextDisplay.class);
Transformation transformation = textDisplay.getTransformation();
player.setPassenger(textDisplay);
transformation.getScale().set(0, 6, 0);
textDisplay.setBillboard(Display.Billboard.VERTICAL);
textDisplay.setText("Test Display");
i've tried scaling the Y thing up and down but it didnt end up doing anything
You never do setTransformation
Is it possible to use JUnit in spigot if it accesses JavaPlugin? I'd imagine not?
Also use translation not scale
Use MockBukkit
Or make your own equivalent
Warning mockbucket Is severely limited in use
uhm i got it working now
BUT its acting very weird its like a bit off its in front of the player model not in the center and its like aslant
Ah okay sounds good. Might just have to avoid testing in things that use spigot. No real sense with what I'm doing
okay nevermind i fixed it
Hello, is this good (about using interface to use nms classes)?
https://paste.md-5.net/ociveniham.java
i haven't looked at the entire code, but this would be a big no for new paper servers (but you asked in spigotmc so I'm not sure if this is relevant)
look at 'How to make sure your plugin does not break' at this thread
tl dr don't assume org.bukkit.craftbukkit. has a version in the package name
is it better to use vertical than center? because i use center for my nametags and it looks fine
I forgot to say that : it's for 1.9-1.12.2
Center also rotates horizontally
oh
I don’t think player names do? Idk
no they dont
btw my textdisplays are spawning very weird
they are spawning on the player heads location means the are rotated like when i look down ingame they spawn like a few blocks away from the player and rotated to the front
you got this problem with yours too?
the same applies 🙂
instead of concatenating version to org.bukkit.craftbukkit. or net.minecraft.server., create a prefix string and reuse it everytime you need to load a class from there, so you don't care if that prefix string has a version in it or no
okay thank you
for me it's that you can sometimes see your own name tag when you enter the swimming/flying animation
so basically:java public String nms; public String craftBukkit;
? @silver robin
but i guess you could just hide your own nametag
but yours are always on top and centered with the head?
ss?
yea
?img btw
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
you mean screenshot?
yea
i looked down while spawning it https://imgur.com/a/WeM8PST
and i can see through it from the other side
that should be an option
looks weird, cna you show your code
Code:
TextDisplay textDisplay = player.getWorld().spawn(player.getEyeLocation(), TextDisplay.class);
Transformation transformation = textDisplay.getTransformation();
player.setPassenger(textDisplay);
transformation.getTranslation().set(0, 1, 0);
textDisplay.setTransformation(transformation);
textDisplay.setBillboard(Display.Billboard.VERTICAL);
textDisplay.setText("Test Display");
CatalyaCore.subTitleMap.put(player.getUniqueId(), textDisplay);
btw the player.getEyeLocation was a test on how to fix it
spawn it on the player location, might not change anything, and rather use addPassenger
but that looks fine to me
no, add to the translation, not set it
it just looks like this for me
val transformation = textDisplay.transformation
transformation.translation.add(0f, 1f, 0f)
textDisplay.transformation = transformation
textDisplay.billboard = Display.Billboard.VERTICAL
player.nameTagDisplay = textDisplay
player.addPassenger(textDisplay)
makes sense ig
there is for me 🤷
transformation.translation.add()
oh you mean that
shut up
yea i figured it out already but thanks
but that doesnt change anything for me lol
it still spawns like this
hopefully immutable
What is
wouldn't have happened with kotlin
oh yea it is mutable 
Does anyone know how the UUID in LoginStart from the client is determined?

btw do you know the name of this?
i can't figure it out alone lol
think it's see through
see through is if i can see it through the walls
okay then wdym
from down: https://imgur.com/a/gharVUT
from up: https://imgur.com/a/X32HUcH
that should be the billboard no?
wdym?
try setting the billboard to center
now its moving with the cam so its moving up and down
and normal nametags do the same thing if i see it correctly
i am so fucking stupid
I haven't found any info on this online
coll smh
is anyone experienced with converting old base64 strings to the new format? e.g. 1.20.2 inventories that should be converted for 1.20.6?
Check the forum post I linked earlier, there is a function you can use
it's just player uuid?
however the server does not use it, and instead uses the one it obtains from minecraft session server when it authenticates the user
My question is: how does a cracked user generate their uuid?
What does he base it on?
Or is it purely random on each join?
oh
https://wiki.vg/Protocol#Spawn_Entity look at the thing below the yellow div
But isn't that the server's way?
Does the client do the exact same thing?
no, the client of course sends his own real UUID (which the server won't use anyway), the client doesn't have to generate anything for that packet
unless you're talking about pirated clients, in which case you gotta find out yourself
In offline mode UUIDs are based on the username
Cracked
in summary, the cracked user does not generate their uuid, the server does that based on their username
Cracked
He
Needs
To
Send
A uuid in login start
uhm i am now having the issue where the new name tag is weirdly moving and is not really mounted to the player in this case
here you see the vanilla nametag and the custom one: https://imgur.com/a/cc9grBJ
the custom one should be at the same location that the vanilla one is but it isnt staying there
you know how to fix it?
What does the client base it on
The client
i told you already, go dig into pirated minecraft code if you wish to know "what data is put in the login start packet"
(which, clients could put anything in there
)
and that's why the server deliberately ignores that data
it isn't that it is deliberate. It is done like that so that there isn't extra code to deal with offline mode
okay thank you
since the server doesn't need to do any verification it simply just doesn't look to the packet for any uuid stuff
but, online mode requires a uuid, so they didn't want to have duplicate stuff 😛
I meant for online users, in feb 2020 there was a mojang-wide exploit because of that packet, when the servers were actually using that data
and for getting nms package?
I looked into it, and uuid isn't involed with that
just as I remembered
the exploit 2 years ago had to do with mojang having legacy auth api still available
had nothing to do with UUID's
unless you are asking for half of the NMS package instead of something specific, you might want to use .getHandle() on OBC objects, it gets most stuff done
otherwise, if there is any connection between Spigot and NMS just how spigot and OBC are closely related, you could resolve NMS package from there, I don't know about any though
well 4 years ago I mean
Then is there any way for the server to send a packet containing a certain value, so that if that same client logs in and the server requests that value the client replies with the saved value?
I am not sure what you are asking
Cookies
But minecraft
ah, my bad then, I was a lot younger and knew less so maybe I had read a bullshit article about that
What about a resource pack?
That's something you can save on the client's pc
okay thanks for your help
you can't get RPs from a client
Can you request for that?
Damn
are you wanting to cache authenticated players?
because I am pretty sure the server already does that
Yes but for cracked players
cracked players don't get authenticated
As an addition to my login plugin
so what are you wanting to cache?
I'm attempting to auth them as long as they join from the same pc
So not mojang auth
My auth
but how would you guarantee that?
that's what they're trying to figure out lol
by the way, this lib worked great, the only thing I'd like to ask for is is there a way to modify the packet before it gets sent S->C, or modify a C->S packet before it gets processed by the server?
That's what I'm trying to figure out
there is only one way to do it that I know of
Yes
Their packet listeners
Do that automatically
So just register a PacketListener
And set PacketEvent#setCancelled(true)
you would need to use your own custom launcher that simulates mojang's auth stuff. Essentially you will have to run your own auth server. However, this is probably one of the few things that would probably land you in hot water as this is directly violates DMCA as the whole user login stuff is considered DRM
Please go on
Ah, no
No custom launcher
Too much hassle
its the only way, and that is how Mojang does their auth
unless you go with a mod I guess
PacketEvents packet data interception and modify
add in the menu to login, and have that sent over using plugin messaging channels or whatever
crazy idea, but, have you considered asking the player for a password? 🤯
this would really be the only way to auth offline players, but its offline which I don't see why they are bothering with such things
yeah lmao
You can replace the auth server that both client and server uses
that will allow for "online" mode
I stated this 😉
but using your auth server
But you're entering mod/custom client territory at that point.
yeah I didn't read the entire convo
I do that
But now I'd want a way for an autologin
Except FastLogin and IP autologin
Since ip autologin might be dangerous
@slender elbow caught supporting offline mode people?
I'd want another way for non-premium to auth
hell yeah I mean what

i literally just asked her that myself lol
Hello, how can I includes those as classes in Class#getMethod? I know how to cast but it returns me an array, so it's not in the arguments of this method...
That looks like reflection. You can just use ClassName.class
but
on what should I use that?
God
On the parameter asking for a class.
I've done that:
protected Object callMethodWithReturn(Object instance, String methodName, Object... args) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException {
Class<?>[] classes = (Class<?>[]) Arrays.stream(args).map(Object::getClass).toArray();
Method method = instance.getClass().getMethod(methodName, classes);
return method.invoke(instance, args);
}```
is it good?
Ye
okay thanks
😭 Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Class;
What line
first id assume
at Class<?>[] classes = (Class<?>[]) Arrays.stream(args).map(Object::getClass).toArray();
you don't get to cast arrays like that
how should I do that then?
for loop
final Class<?>[] array = Arrays.stream(args).map(Object::getClass).toArray(Class[]::new)
oh okay thanks
What's the type then
Oh it's a Object[]
But each entry holds a Class
I guess
Yea that is going to be the non fun part of "dynamically" guessing the method signature
arrays are covariant so i dont see the issue here
reflection looks like so much fun
i'm so glad i don't use it
Array.newInstance moment probably
What?
arrays are objects like anything else
if you create a Object[] and fill that with strings, that does not magically make it a String[]
Try casting new Object[10]
it is an Object[] array but with strings inside, not a String[] with strings inside
/\
i mean that isn't gonna work but for different reasons
that T[] is a subtype of U[] where T extends U?
whereas generics are invariant
you can cast a String[] into an Object[] just fine, but that doesn't mean you can cast every Object[] into a String[]
That is why you'll get the lovely message of not being able to instanciate a generic array
if you worked a bit with java, I am sure you ran into that message
type erasure ofc yes
yea its because the array type is more than just "array of something"
actually, not superclass but the implemented interface 🤓
Is it normal for some things to just not appear in the 1.20.6 snapshot? 🤨 or did I break my maven, cannot find random things such as EventPriority, or EquipmentSlot
update intellij
get sniped
update intellij
update vscode

"You already have the latest version of IntelliJ IDEA and plugins installed." hmmm
How do i get if a message contains a url?
regexp?
Are you compiling with java 21?
Whats that
corretto-21
Regular Expressions

what version is that?
'magine forgetting to do that
And how would i use that to check if its a url
create a Pattern, and use it to create a matcher for a string
Build #IC-222.4554.10, built on March 14, 2023
update to IntelliJ 2024
Hello, how can I define the color of a redstone particle in nms? Here is what protocol says
but, actually when I put my values of rgb in data, divided by 255, I get a red dust, and without dividing, looks like it's a random color
afaik nowadays the color is written as 3 floats, 0-1 for each rgb component
it's for an old time, 1.9-1.12.2
ah good luck
lol, thanks
Does anyone know why my server keeps "timing out" when I try and load this schematic?
heres what the schamatic page says
Probably because it's a massive schematic
You should be using FAWE if you need to modify large chunks of the world.
oh, okay
so do I just delete my old worldedit plugin and try and use FAWE
yes
i mean it should
It's a significant improvement over regular worldedit.
?tas
There are a few bugs with some of the more advanced commands, but it's far better for general stuff like pasting schems and simple edits.
Especially since it uses workload distribution
type shit
Hi, how to make custom drops in BlockBreakEvent, I tried adding my item do getDrops(), but getDrops() creates copy.
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
Is there some way how to get plugin main class else than static getter in main class or sending true constructor to all classes? I want to build PDC util but I kinda dont want to send main class true all classes with will use this util.
sounds better and I will not need to send instnace to every class witch will use pdc, or I will just make static getter for this and fkit and how bad it is lol
why are you avoiding OOP?
he's come from C
there is objective C
not necessarily, just a different style
i mean tbh NamespacedKeys are something you should be able to keep as constants, which you can if you use the deprecated factory methods anyway
it is anyoing for me to send the main class to each class that will work with PDC... I know I should do that that way lol
ok, but why would every single class need the main class?
nah but lot of them
then you have a design problem if that is the case
I only need main class bcs of NamespacedKey... thats the issiue
mostly I will need NamespacedKey not main class it self
so pass that to another class
but will need main class for them
or just use the constructor that takes two strings 😉
or that
Or use the static getter from JavaPlugin to use for the key.
yep... probably will need to do that, I will make some enum list or what ever that will hold my NameSpacedKeys that will be best probably
that will be the easiest way, but thats not the way how should be done I guess
Okey thanks, kinda want to store PDC keys in enum (maybe list/map will be better) to be ezy accessible and consistent that what I will think of how to do it on my own. Thanks guys
when I add a new property in config.yml, and run the plugin, the old config file remains and the new property isn't in there
I just do this.saveDefaultConfig() for now
any way to update the config without losing previous data?
Not with a simple api method.
You have to add the sections yourself.
Hi. Does every OfflinePlayer i get with getOfflinePlayers from the server cache have a PlayerProfile with Textures and a name? Or are there cases that dont have them?
I don't think it stores textures
or does it have an alternative
okay
What do you mean? In spigot?
I want to get the class that is implementing org.spigot.scoreboard.Team, I cannot find it, probably because CraftBukkit has nothing to do with Spigot classes.
but I still need the class
my main goal:
I try to send PacketPlayOutScoreboardTeam to hide a username of my npc, but I don't exactly know how I could do it.
but the NPC is not registered into the server it is just sent with packets
… I mean I’d give you a ?tas, but why would you do that anyway?
I will try to just register the team and then add the npc into it, I don't know how this will work, I did not register it anywhere.
Does anyone know any spigot NPC mods where if you right click or smth it teleports you like a rtp command? (that is free)
Citizens is a paid plugin though no?
no
it's paid on spigotmc
You can get it for free
does the bukkit one still work?
but you can get it for free
on 1.20
would it work on 1.20 (the free one)
There is no difference
ok
Citizens is pay for support
Truth
Tbf I hope you have time to try it either way
Citizens is pretty cool
why me
Not you specifically
Just meant whether you pay to support or just get it free, you should have the time to test it lol
ok xd
i don't run a server
