#help-development
1 messages · Page 887 of 1
And nothing else?
nope
Because I fully expect Placed: Pig
Okay, and what happens if you spawn in an item frame/amor stand/whatever?
But the thing with the itemframes etc doesnt get logged and it automaticly despawns (event.setCanceled(true))
As i said, try HangingPlaceEvent for item frames and paintings
And what should i do with the entityspawn event then? I mean if i just put event.setCanceled(true) there there is no sense of the hangingplaceevent cause it automaticly despawns anyway
Sorry im new to coding too btw.
If it doesnt print anything about itemframes when you cancel it, then its not that part of code that cancels it
I mean i have something else for creatures but im pretty sure a item frame isnt a creature..
@EventHandler
public void onCreatureSpawn(CreatureSpawnEvent event) {
event.setCancelled(true);
}
@EventHandler
public void onSpawn(EntitySpawnEvent event) {
System.out.println(event.getEntityType());
}
what does this print when you place an itemframe?
Let me see one second
Doesnt print anything wtf
But theres no where else that checks the entityspawnevent
Do you want me to screenshare real quick?
placing itemframes etc will only call a HangingPlaceEvent from what I see. You must be cancelling placing them somewhere else, e.g. playerinteractevent or sth
Yep only HangingPlaceEvent is triggered when a painting or item frame is placed
Just found out why and im so stupid..
Every 2 seconds all entities are being removed automaticly by my plugin, i dont know why i did that but it was stupid. Thanks for your help though!

update: I wrote a load balancing service in like 5 hours
I can just be like "hey I need at least 5 games up" and it'll pick servers and do it
I think I can get this done in like a third of the deadline if I really try to
Nice
whats the best away to go about saving data to a chunk? im making a plugin where you can claim chunks and i want to have the owner and other stuff attatched to the chunk, should i create a file for each chunk?
PDC?
Either that or get the chunk key and use it as an index in a database or sumn
I use sumn like this https://gist.github.com/IllusionTheDev/7c3a524d75677a5523f38a176a710dcc for individual blocks
how would i get the key? i kinda wanna make a file for each chunk since im gonna be storing quite a lot of data
Check the code
public static long getChunkKey(int x, int z) {
return ((long) x << 32) | (z & 0xffffffffL);
}
so i assume id just do the x and z for a location within the chunk and itll give me a unique key for that chunk?
That's chunkX and chunkZ
For a key within the chunk there's the other method
public static int getBlockKey(int x, int y, int z) {
// x and z are 4 bits
// y is 8 bits
return ((x & 0xf) << 12) | ((y & 0xff) << 4) | (z & 0xf);
}
If you're storing A LOT of data it might be better to order them in XZY instead of XYZ
im kinda confused, im just trying to get a unique key for each chunk so i can create a file with that and get a file with that so if i had 1, 1, 1, get a unique id for the chunk that location is in, then if i did like get(2, 2, 2), id get that file as well since its in the same chunk, just a different location
Yeah so
Each chunk has a coordinate
Which you can get by doing locationX / 16, locationZ / 16
So that can be your file
Anyone know how ItemsAdder crops work? Like, it's planted do they have custom models? I'm making a custom crops plugin that's going to support ItemsAdder crops.
why setting the base value of generic max health can produce nullpointerexception
alright thanks
declaration: package: org.bukkit.attribute, interface: Attributable
@echo basalt how do you guys manage configs at work
is it just the hard coded string .get
Idk why but I just don't trust that lmao
Or here if you don't care about reloading
this abstractconfig stuff is multi-platform
🤔
here's my code:
fun registerSerializers(packageName: String) =
Reflections(
ConfigurationBuilder()
.forPackage(packageName)
.setScanners(Scanners.SubTypes)
)
.getSubTypesOf(Serializer::class.java)
.forEach {
val serializer = it.getDeclaredConstructor().newInstance() as Serializer<*>
registerSerializer(serializer)
}``` and da error:
```java.lang.NoSuchMethodError: 'org.reflections.util.FilterBuilder org.reflections.util.FilterBuilder.excludePattern(java.lang.String)'``` i dont use reflections that much so i have no clue
I use it like everywhere
shade
Yay reflection based configs
that didn't seem to fix it
Oh this actually looks nice now that I think of it
Ima guess it also does the io operations
kinda ugly but whatever
sqlite annotation api
generates everything for ya
sus
actually so true
i was wanting to use reflections api for serializers
but its whatever
i have another method just more bulky for the user
👍
what theme are u using
This is why I keep my field names and config names separate
So changing the field name doesn’t break old configs
ok but what if you want to change the config field name
it breaks, cuz its sqlite
sqlite sucks for updating a table
use mongodb for that
couldnt you just ALTER TABLE name RENAME COLUMN name to newname
i mean you rename yeah
what I think you can do
but changing a value is different
i could make a migration system but honestly, too lazy
so in each config have a "version"
that doesnt really work for sql
well, it could but its not funnest
you would end up 1 table per version and have a wrapper table which is more data and then you have to handle converting an updating all that data and its just not fun
especially when theres tons of it
or just never change them
lol
how would i turn a bukkit color to a normal java color
what do you mean by a normal java color
java.awt.Color
whats better, gradle or maven
Totally depends on what you need and your preferences. In most case maven is enough
Maven: Very fast
Gradle: More configuration and easier to modify build process
gradle can be very fast as well, sometimes faster, sometimes slower
It takes me 100 seconds to buildFatJar with Gradle 🥲
Not a plugin , a rest API, but like still
I mean gradle has auto incremental builds and can use the daemon, but like it all comes down to what you need, as said there are many times when gradle beats maven, at leaat there used to be solid metrics saying that, unsure whether newer versions of maven addressed the competition correspondingly
how can I write
start a plugin if I don't have Minecraft Development? Do I just need to create that structure and add dependencies on spigot?
I just updated idea, but it doesn’t support Minecraft Development
Google 'papermc development guide' or 'papermc plugin.yml'
both maven and gradle are fast if you know how to use both of them. Thing is, Maven is designed to be conservative with resources by default out of the box. This increases the odds of successful builds without much worry in way of configuring. Gradle is the opposite and will attempt to consume larger amount of resources however has the side effect of failing out of the box if on a low spec system
for the most part in terms of plugin development there it is really down to preference which is used. There is limited plugins that are large enough to even remotely see the effects of either of them
You need either a gradle or maven project, then you add your dependencies you need. Either the API jar as a dependency or server jar, then you make your main class for the plugin which is going to be same for the most part for any plugin and then if using manen toss a plugin.yml into the resources directory, make the directory if it isn't already there
you don't necessarily need the MC dev plugin for IntelliJ to actually do plugin development
some of us here don't even use IJ at all such as myself. I use Netbeans which does not have such plugins like MC Development 😉
The advantage of using MC Development is that it takes care of setting up the structure for you, like adding the plugin.yml etc
creating the main class file with the onEnable and related methods etc. However you can actually accomplish this youself by creating a project template
and then using your template anytime you want a structure for plugin project
I am pretty sure IJ is capable of this, I know Netbeans is
Bros wrote essays💀☠️
Hey i added this in my pom.xml
<dependency>
<groupId>anything</groupId>
<artifactId>anything</artifactId>
<version>1</version>
<scope>system</scope>
<systemPath>${HOME}/what/ever/the/path</systemPath>
</dependency>
``` so the issue is when i build it with `mvn clean package`. i got `NoClassDefFound` errors in the console.
so how can i make this file compiles with other deps? thank you
have you debugged system path and made sure its correct
100% correct, i got the auto complete
system dependencies don't get shaded
that's correct
why do you use system scope?
you are supposed to use compile if you want to shade it
how? the compile doesn't get the systemPath in it
how can i attach a file to a compile scope?
me have no clue xd
just include the dependency normally
but how can i fix it rly quick?
Sometimes you have a certain .jar file that you need as dependency, but the author of that .jar was too lazy to properly upload it to a public repository. That’s bad, but not a problem. There are two ways to solve this, but only one proper way. The proper way: install the dependency The proper...
thank you imma see how it goes
- install your dependency to your local maven repo (
mvn install:install-file ...) - add it to the pom with scope compile, and without systempath
got it, i'll follow the blog. thank you
np
why would it be deprecated?
it would be dumb if it was, because how else are you supposed to declare a dependency that is on the system but no where else? lol
Forgor this was spigot dc I was 10/10 sure it was paper
@tender shard i have around 30m trying and from ur blog it works perfectly thank you again 🫡
np!
maven docs say so
the proper way would be to setup a repository layout and include that
obviously not if its a system dependency
Anyways, its deprecated but nothing replaces it
so yeah you are right as it does say deprecated
Removed in 4X even
hey protocoLib 1.20.1 exists now? were i can find it?
System scope makes little sense. But for 90% of cases you can use file:// repositories. For the rest you can generate potemkin jars
Its Jenkins?
Yeah, so Jenkins
Though 1.20.1 might have been a version that was too short-lived to have received an update
i was find this in forum but the link is not working
But I have 0 knowledge about MC versions beyond 1.16
Common sense?
i mean what the version
this for 1.20.1?
in spigotMC protocolLib 1.20.1 not exists....
were you find this
give link bro
As I said, I googled their Jenkins, got the latest build and well here we are
the link works fine?
yes work but this for 1.8-> 1.20.2 or 1.20.4?
site have 2 links "1.8 -> 1.20.2" link not work
I don't know. why even use anything but 1.20.4?
if build #679 doesnt work, there is no version for 1.20.2
do you mean that 1.20.4 works on 1.20.1?
?
No he's saying update your server
I told you, I don't know. And I said that if the linked version of PLib doesnt work, no version will work. Update spigot

your version is rusty
old spigot versions are based on rust? /s
it's kind of strange don't you think? There is a version for 1.20.4 but not for 1.20.1
why would your server run on 1.20.1 instead of 1.20.4?
this is not for my server
my server is on 1.16.5
Question still stands - for whatever server
I answered your question. I don't know, maybe people don't like 1.20.4
because the farther you go, the lower the fps
Maybe you shouldn't run the game or servers on 10 year old hardware
after 1.16.5 it really gets worse
everyone already knows
and technology has nothing to do with it
my pc is not cheap
this not for my server i'm making a plugin for someone else
Then tell them to update. There won't be any gameplay difference between 1.20.1 and 1.20.4 anyway
is there a way to directly download a jar from a maven repository?
link
it's literally any lib page on maven
the standard maven repo.
https://mvnrepository.com/artifact/org.springframework/spring-core/6.1.3
thanks a lot
👍
I had a cool website that'd download all of it's dependencies as well and compress it all in a single jar
whats the item name for colored leather armor
huh, which armor is Colorable but not Leather?
Hello guys
im looking for someone who can write me 1 plugin
for 15$
its simple plugin
?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/
How would I go about having a KeybindComponent shown in an items lore? As lore only accepts strings :/
If you want it to show the players kebinds you would have to update that every time the player changes them
which is impossible as no packets are sent when a player changes keybinds.
wrong, there are vanilla text components that show the lore
?
But spigot (to my knowledge) does not allow you to set them
So I made my own (NMS) hack
https://github.com/steve6472/StevesFunnyLibrary/blob/44240bbace1eb0a7a5d55793b0fee1ab80188150/src/main/java/steve6472/funnylib/util/NMS.java#L93
Mind you, this function only allows me to set raw JSON text as lore
You'd have to construct that lore somehow, I have JSONMessage class for that, it is in the same repo somewhere.
you can set the itemstack's name to components using UnsafeValues#modifyItemStack(...)
or just directly create it from a string https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/ItemFactory.html#createItemStack(java.lang.String)
declaration: package: org.bukkit.inventory, interface: ItemFactory
not very nice though
whats a good way to make it so every enchant table always act like it is at max power without bookshelves around it.
It's okay, it will be updated frequently enough
ig I#ll just say 'right click' and not get the keybind
I have this module, and it's jar file is found, but the class is not
PrepareItemEnchantEvent
and override the offers with maximum power
Show the full log
wait, the classes just didn't build
Are you not using maven or gradle?
but now I have another issue
yeah, tbh who even doesnt use right click?
No gradle/maven = RIP
did you properly restart the server?
I just removed the extra delegation to another file
yeah, each time
and extracted it directly
oh, then I have another problem
I'm saving user information into a file
but if I shutdown the server by closing the terminal, there's a non-zero chance that not only the current information won't save, but also it'll all be erased
I'm saving all users into one file
yeah well if you just Ctrl+C it, ofc it doesn't have time to save anything
either save your data directly when it changes, or every X minutes
and saving all users into one file probably isn't such a good idea
how heavy is file saving anyway?
depends. it's extremely fast or extremely slow
uh
but you shouldnt worry because you should do it async anyway
(except in onDisable, there you should do it synced)
I do it on WorldSaveEvent and onDisable
i usually keep a list of completableFutures for "saving tasks" and in onDisable I just join() them
async
how does that work?
I got a storageManager that keeps track of storages (a storage is usually one mysql table or one json file, etc)
It has a method shutdown() that returns a CompletableFuture.allOf(...) all tasks that need to be saved. And in onDisable I call that shutdown() method and get() it (to force it do be done right now) https://github.com/SpigotBasics/basics/blob/main/plugin/src/main/kotlin/com/github/spigotbasics/plugin/BasicsPluginImpl.kt#L132
https://github.com/SpigotBasics/basics/blob/main/core/src/main/kotlin/com/github/spigotbasics/core/storage/NamespacedStorage.kt#L58
Kotlin
seems pretty similar
what if I were to just save it every 10 seconds?
but I still don't get how my file information can be all erased on a sudden crash
is it possible that if the immediate crash occurs just at the moment the file's writer opens and resets the file's lines?
No idea
well yea
huh?
or is it just compiler removing calls?
it should load it either way
I tried this
didn't work
(on my own class ofc)
first of all why do you need to load it
I use this to force load a class and all its anonymous inner classes https://github.com/SpigotBasics/basics/blob/b446b698c2d2f5385266a37f2adcfda72216ce78/core/src/main/kotlin/com/github/spigotbasics/core/util/ClassLoaderFixer.kt#L84
Yeah just assigning the class to something should work
You can always double check the compiler code to make sure the compiler didn’t yeet it
what packet for elytra animation?
PacketPlayOutGameStateChange I think
can you give wiki.vg link?
thats not out packets
client bound
a
then try spoofing window items
replace chestplate with elytra
and set player.setGliding(true)
Is it better to save a bunch of stats that are 0 in a configfile but create them all at once, or only save stats that are greater than 0 but add new stats to the configfile everytime someone changes a stat from 0-1
Example 1:
UUID:
playtime: 0.1
kills: 0
deaths: 0
Example 2:
UUID:
playtime: 0.1
Example 2 after player gets first kill:
UUID:
playtime: 0.1
kills: 1
Alright thanks
It depends
I mean given a specific stat, if you can define a policy that absence implies 0 then sure
But it can become a bit complicated if you for some stats want another default/fallback value
Or if per say, you want to change the default/fallback value, or change the format of how the data is structured
👍 the stats i'm working with should all be default 0/false so for now i'm good thanks both
is there something that is like a hashmap, but the key has multiple values, depending on a second parameter?
example:
myMap.get(key, parameter1); returns hello
myMap.get(key, parameter2); retuns goodbye
You can make your own class for that
i can, but im not sure if im smart enough for this kind of stuff
sounds like you want a Table or a MultiMap?
multimap?
You could also just concat the key and param and then use that as the key in the hashmap
a Table<C, R, V> is a Map<C, Map<R, V>>
a Multimap is a Map<K, Collection<V>>
guava has both of those
Bukkit exposes FastUtil when????
Man clearly I just need to fork nms not like I use api anyways 
No wonder it seemed It dissaprared after I stopped working
sigh well maybe I'll throw out a pr tonight if I have time
tbf, Bukkit really should expose FastUtil. It's so useful lol
guys
And girls
Keep talking
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
In that case,
Can you guys tell me how can I create a custom written book
sorry btw
I've tried some methods but they didn't work
Lol awesome question
Create a Maven project and just add the repo, dependencies and plugin.yml yourselves ig
What exactly have you tried
And what exactly didn't work
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Gimme the time to answer
i want to learn spigot uhh
When I open the book it says "invalid book tag"
Do you know Java?
I wasn't rushing you, cafebabe was weirding out
yeap
i can improve myself if i can learn basic things about spigot
thanks
@icy beacon
Do not ping me please
Oh sorry man
I've read your message and I do not know what to tell you
You provided basically no information
No code you've written
Nothing you've used
So how exactly can I help you
Time to bring the mind reader
Lemme screenshot
The book tag is invalid try again
🪄
Don't send text as an image
Okok
?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() {
}
}```
I have a GenericObject<K> in a HashMap, is it possible to know what K is when i get the object?
yesnt
BookMeta libromultam = (BookMeta) libromulta.getItemMeta();
libromultam.setAuthor("Polizia");
List<String> multa = List.of();
multa.add("§7------§9§lMULTA§7------");
libromultam.setPages(multa);
libromulta.setItemMeta(libromultam);
target.getInventory().addItem(libromulta); ```
?
i don't have the keys to format the codeblock
K extends blablba? or why yesnt?
what
Yeah you did it though?
brain not braining
yep
btw I cant figure out what's the problem in that code
Ok I'm not sure what exactly is the problem, how about you try to comment stuff one by one. So comment out the setAuthor line and see if that helps, then comment out setPages and see if that helps
ok lemme try
Set a title
well type erasure
At some point you may need to make a well-educated guess based on the runtime what type it is
this is so strange because if i set the title it says that an error occured while if i remove that line that sets the title it work but when i opejn thge book it says "invalid book tag"
Books require title and author
yes but when i set the title everything goes wrong
if i delete the title line it says 'invalid book tag'
it satisfies this requiremetns
Can you send the code once again?
Also send the stacktrace of the error
ItemStack libromulta = new ItemStack(Material.WRITTEN_BOOK,1);
BookMeta libromultam = (BookMeta) libromulta.getItemMeta();
libromultam.setTitle("§9§lMULTA");
libromultam.setAuthor("Polizia");
List<String> multa = List.of();
multa.add("§7------§9§lMULTA§7------");
libromultam.setPages(multa);
libromulta.setItemMeta(libromultam);
org.bukkit.command.CommandException: Unhandled exception executing command 'multa' in plugin Lavori v1.0
Nothing else?
Yeah is there anything else below that which is an error?
executing command 'multa'
there is a the part that says
net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1191) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:1) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.util.thread.IAsyncTaskHandler.x(SourceFile:130) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.server.MinecraftServer.bl(MinecraftServer.java:1170) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1163) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.util.thread.IAsyncTaskHandler.c(SourceFile:139) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4] at net.minecraft.server.MinecraftServer.w_(MinecraftServer.java:1147) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4018-Spigot-864e4ac-95bc1c4]
o cant paste it all
its too long
?paste
We need the entire thing please
ill send it as a file
^^^
Use this
Whya file
Also I strongly advice you to read this: https://www.spigotmc.org/threads/tutorial-how-to-read-stacktraces-solve-most-of-your-plugin-problems-by-yourself.48121/
List.of() is immutable
Will help you a LOT in the future
Oh shit you're right lol
Create it as new ArrayList<>() instead
it worked,thank you guys
I am trying to make a plugin to set bounties on players. When a player sets a bounty, it should go to some type of database with the player's UUID and the amount of the bounty. What database should I use? I was thinking SQLite. I want the plugin to be plug and play.
thanks, that's what I was looking for
just wanted to make sure that there wasn't a better way of doing it
sqlite, h2, flatfiles, ...
are flatfiles really that efficient?
If you are looking to later expand it to support cross server then start with SQLite, if it's only ever going to be a single server use built in yaml
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
compared to what?
sqlite
it'll hardly make any difference
fair
both have advantages and disadvantages. e.g.
json files: can be easily edited, only have to save files that changed -> daily incremental backup doesnt have to copy a 50mb database everytime
sqlite: only one file, you don't end up backing up 81729 files every day
I'd always let the admin choose whether they want mysql, sqlite or flatfile
I don't have the slightest clue as to how I'd implement that with yaml. I thought that was only for configs and stuff honestly
Hello Team,
im searching for the challenges.jar on the Spigot website but i cant find it any1 know where i can download this
thanks for helping
Challenges.jar can be sooo many plugins
Ok not that many but if you're looking for a plugin you gotta at least know its name or author lol
or so you think I actually know of 1 plugin who specifically downloads the Challenge.jar file. Unfortuantely such information can't be given out for free the plugin is too powerful. It could accidentally create the next Hypixel and destroy the balance in the server eco system
Y2K_ asserting his dominance as always. I am defeated and leaving
I hope I can be as strong and powerful as you one day...
you have much to learn
*anime music starts playing*
hopefully its not from the Anime my PFP is from otherwise its gonna be peaceful anime music
and that's not the vibe I'm going for
More like Tomodachi Game's opening
when im buying a server which one i schould get to play the plugin the spigot one or vanilla?
story of my life
Also, 2GB of RAM will probably not get you far. Players and plugins take up ram really fast
(I don't remember doing most of this)
how much should i look for
and ended up with a whole game management service 
Your code style is the wet dream of many corporations
Depending on how large you plan for your server to be
I guess you can get around with 2GB in the very beginning but as you'll be expanding and/or your playerbase will be expanding, you'll need more ram
This is #help-server territory
4+ imho
anyways this is def #help-server we humble developers can't help you constructor the next hypixel
ok tyvm
I remember a dude asked me to help administrate his server, I sshed into his vps to see how things were going and saw him OOMing with 12GB on a 3 server bungee proxy
Turns out he allocated like 8GB for bungee and then like 1gb for each server
I think I had an OOM yesterday
I am not sure what the thought process was behind that
How much ram have you got?
I gave my game service like 128mb
uh
but I tried making a string with Integer.MAX_LIMIT size because I was reading packets wrong
easy fix
Holy cow, that's a large string
I'm surprised this uses 75mb ram with like 5mb of disk space
@echo basalt I'll have you know thouhg at minimum I am not bored
I have been creating a custom Menu API to wrap NMS
it has been amazing no issues
besides when IntelliJ crashed lsat night and I lost all of my implementaiton progress
I smashed my keyboard and started crying
lmfao
don't you have auto save turned on
yes
but it seems to not autosave when crashes occur
it saves whenever I change windows or files lol
maybe this is a lindux moment
see I accidently decompiled CraftItemStack wihch fo rsome reasons always crashed my intellij
and by the time I realized my mistake I couldn't exit out and had already crashed
^ Note I can somehow decompile Material enum fine
Same thing happens to me sometimes… usually when I’m like copying a large class to have it checked out… just freezes IJ and have to force close it after that
strange this is I'm never given a direct reason I'd expect atlesat maybe an OOM error
I just get the basic windows "application has stopped responding"
Other than that, there's absolutely nothing coming / logging from IJ
linux doesn't have that beautiful "application not responding" screen
atleast gnome doesn't
idk about KDE or XFCE
Wouldn't know, I've only ever used windows haha
However, it is quite odd how a single crash can sometimes wipe upwards of like 200 lines...
Its an easy solution, just be like the cool kids (me) and use google docs 😎
please, I need skulls like youtube, tiktok etc. for my menu how can i do that. I saw somewhere that it is synced with player so when someone changes that skin will it change also my skull in game?
When google releases an ide, they will go bankrupt... or get sued for stealing everyone's code
I know especially with auto save on
It should theoretically save ever few seconds for me
how I manage to lose 400 lines of code even though auto save should run every 3 seconds is wild
^ same here but never does when it crashed
my guess is they have a buffer or something
Growing up trained me to press CTRL S every 10 seconds without even thinking
Same I still do it
I might manually revert back to manual save because I do press ctrl+s even though I have auto save
The issue that even then, intelliJ still sometimes doesnt save...
so if you forget to do it for a solid 3 minutes that could be an easy 6 methods gone D:
I lost an entire file last night
Also:
Inventory bountyInventory = Bukkit.createInventory(null, 36, ChatColor.AQUA + "Bounty GUI");
for (OfflinePlayer target : Bukkit.getOfflinePlayers()) {
ItemStack playerHead = getPlayerHead(target.getUniqueId());
bountyInventory.addItem(playerHead);
}```
I think this will work for a function like that? Might have to play around with it a bit however
eek
I have to do it to finish my API though
that was my Slot Listening API
Was it like finished?
yeah
That's so awful
I was a couple line away from finishing before I pressed f3 on accident
and decompiled CraftItemStack
💀
That's like witnessing a murder
I usually actually have stash open on CraftItemStack for this reason
so that I can reflect and commit cirmes in peace
Thanks but I mean like exact head. So I have discord head for my discord link. Is there way to do that?
I still think I want to make my own ItemStack implementation I hate how much copying CraftBukkit does
especially with the ItemMeta its kinda evil
need to switch that over to NBT probably
Ehm, I'm not to sure I understand that. Do you mean there's a skull in your menu that players click to receive discord link correct?
Yes. and it has like discord icon
I will probably find someone with discord head skin online but will it change when that player changes skin?
Uh I think you'd have to make a custom head with new models that represent the discord logo or wtv
If they've never logged on your server, I'm not sure the method I sent will work actually
It might just replace their head with a generic minecraft skull ie: alex, steve, etc
I think the best way is to probably bite the bullet and just model your own skull
Or perhaps be patient for help here, there are a lot more people who know quite a bit more than I do
1.21 is honestly shaping up to be a great update not even for the actual gameplay changes lmao
the technical changes are great
Imagine keeping up to date
we basically also now have gravity and block break speed attributes
in addition to scale, block reach, entity reach, step height
all these attributes that should have been implemented from the start are now being implemented
Oi so instead of needing like an implementation of haste, you can directly modify the break speed on the block now??
That's pretty cool
Any good tutorials from where I can learn Reflections?
yeah
hacky custom mining using mining fatigue and running tasks are no longer really necessary
unless you want to change the hardness of a block
That'll probably only run for like prison servers, seeing as though most of them have like "layered" blocks or whatever you wanna call them
p much
At the same time, there are a lot of things I could play around with to make perhaps more vanilla mechanics better to actually grind out
Obviously it's not just limited to prison servers, but still I think that'll be the main implementation of those new methods
Sorry but this isn't the right location to look for devs
?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/
post-launch comp usually implies no money 
true
Yeah loading hprof files take a LOT of ram
I also ran out while trying to read mine
How large is your dump?
23gb D:
Mine was only 8
wish this was 8 too
and I ran out of 32GB ram while loading it
So the program crashed with out of memory error
VisualVM?
ye
does windows not have a working swap file?
otherwise spin up a debian VM with 24 gb ram and 32 gb swap :p
somehow VisualVM did it
and YourKit didn't
now the main problem is, what is the cause of the memory leak
It does but it's quite small by default
tbh i was thinking about that
to increase it for this task
now, how can i feagure out what is the cause of memory leak?
using VisualVM
this things are the largest stuff in the memory
take one of those locations, right click -> show nearest GC root
this is the only options
fun fact: I only got 1 location in my heap even though I'm running a 3mb plugin lol
uhhh why are there 30 mil PlayerMoveEvent objects 💀
better ask the plugin author when we find out which one is
on a reference
I think
wait lemme check
select one specific location (not its references or anything) and then GC root in the menu bar
i can't see that GC root
show a screenshot of your whole window
well I see the GC root in your screenshot
1.17 and 1.17.x - have equals NMS?
i hope this joke
Well, for example, don’t change the old by adding a new one
500 error
any way i can raytrace a line and get all the entities hit by that line? regular raytrace stops at the first entity hit
the method names are randomly generated
demmm
you should just use mojang maps, then you don't have any issues
that is, for each version you need to add support?
if you don't use mojang maps, then yes
what if i will?
AAAA
don't give up 🥲
then your code will stay 99 % the same between versions, and you only have to compile it again against the new mappings
which basically means, updating to a newer version is as easy as adjusting one line in your pom.xml or build.gradle file
bad and good news
bad one is that computing was for refrences
good news is it didn't crashed
I need to create support for a plugin from 1.17.x to 1.20.1 at what stages do I need to change the plugin logic
GC is still computing
in all?
weren't you able to see the reference before running GC root?
no, you'll only have to add support for 1.20.4 and 1.20.2
nobody uses 1.17 anymore
i clicked on the refrences and it started to computing
and you said click on gc root
and only 1.4% use 1.17.1
yeah I didnt know that it'll take so long for you :p
This is a personal order not for the public
can you see the "references" before you click on GC root? or does that also take long to load?
theres a couple people still who insist on using 1.8 purely for the combat system, or the better performance
try to find a location where the references already shows that it's stored in some plugin. then run GC root for that
takes so long to load
but uhh ill ask again, is there any way to raytrace for entities without having it stop on the first entity hit
well couldnt you have taken a smaller heapdump?
i need all entities in a line
couldnt you have started the server with e.g. 4gb ram, then play for 2 minutes, then take a heapdump?
no really
it was set to 20GB memory
(not by me)
because grown uncles were living at the time. A sense of nostalgia
you can make the combat look like that on 1.20 too, but the performance on client? no
mojang moment
its like comparing new games to the old ones like comparing Warzone 3 to 1
the graphics are better, a lot of new things are there and more
but its not optimized too yea i agree
soo who was use NMS Version support only needs to be created for 1.17 -> 1.18 -> 1.19 -> 1.20 if using Maping ?
this memory leak doesn't happen all the time
something makes it to happen
so i didn't wanted to miss it
It really isn't that 1.20 is worse optimized than 1.8
1.8 just has a lot fewer features
It actually shows how the way a game is made and how they differ from corporations and regular people who put their heart and soul into the game. Globalization vs hobby
1.20 is probably way better optimized than 1.8 but yea it just has much less
no
I saw a video somewhere with fps tests.
it seems like you don't understand what we're saying
something being better optimized doesnt necessarily mean it will perform better 1:1
like
its like comparing a console calculator program to something more advanced like terraria or something
bit of an extreme example obviously but you dont go around saying that this shitty calculator program is better than terraria in terms of performance
Again that's not what we're talking about
its kind of an unfair comparison
oh i was want click not to your message
.
if you stripped 1.20 of its features to be equivalent to 1.8 then 1.20 would perform better
is kinda what we getting at
thats an equal comparison
in 1st place it is 1.14 and it is not a “calculator” so the comparison is appropriate.
in 2nd place 1.16.5
1.20.1 in 10
is it purely comparing fps
because its not a fair comparison lol
you're comparing something with fewer features to many
like of course the one with many more features is gonna perform worse
well, let’s say 1.14 is not suitable for comparison; 1.16 is closer to 1.20.1 and still in 2nd place, and 1.20.1 is 10
its not something that can be definitively judged based off of an fps example
something can perform better but that doesnt mean you can say its better optimized if it has less features
you cant tell without making the actual features equivalent first
Do you think the difference of 200 fps can be justified by their functions?
fuckin maybe how can i know that
@tender shard isn't it better to compute the gc root of all Locations? clicking on the 60mil location, comute GC root and wait instead of doing just one of it? i'm scared i can't find the cause by just computing the gc root of one location
you can check by adding generation from 1.20.1 to 1.16 👍
i dont know if that wouldnt take forever
try it I guess
as soon as you find a plugin or sth, you can go to object and check which other references it holds
because it caches in files after it loads it
so maybe there is a lot of plugins which there is
i'll try the forever option then
its computing a percent per 30 seconds, nice
If I have a git branch that was merged and then I use that branch to make more changes and want to PR the new changes, will all of the previous commits to the branch interfere with merging? Should I just make a new branch instead?
if all the commits were merged, then it's no problem. They'll show up twice in the git history, though. Usually you'd pull the merge commit to your local branch
Usually though you'll want to just make a new branch
@chrome beacon btw did you tried to set the maximum ram for VisualVM?
i loaded the 23gb heap on 32gb memory, you should be able to do 8gb for sure
it takes for ever, i'll load the server on 8GB later
i hope 8GB doesn't take forever too
in the visualvm configuration file
Can't give it more than my system has
is there an easier way to multicatch in kotlin?
package com.github.spigotbasics.core.extensions
import kotlin.reflect.KClass
inline fun <R> (() -> R).multiCatch(vararg classes: KClass<out Throwable>, thenDo: () -> R): R {
return try {
this()
} catch (ex: Throwable) {
if(ex::class in classes) thenDo() else throw ex
}
}
inline fun <R> Throwable.multiCatch(vararg classes: KClass<out Throwable>, thenDo: () -> R): R {
if (classes.any { this::class.java.isAssignableFrom(it.java) }) {
return thenDo()
} else throw this
}
except ofc catching Throwable and then checking when(e) { is FirstException, is SecondException -> { ... } }
maybe runCatching
hm how would that look like?
e.g. here, I want to catch three exceptions instead of one for the UnsupportedServerSoftware thingy:
try {
returned = executor!!.execute(context)
try {
returned?.process(context)
} catch (e: Exception) {
logger.log(Level.SEVERE, "Error processing returned command result for ${info.name}", e)
}
return true
} catch (e: BasicsCommandException) {
try {
e.commandResult.process(context)
} catch (e: Exception) {
logger.log(Level.SEVERE, "Error processing thrown command result for ${info.name}", e)
}
return true
} catch (e: UnsupportedServerSoftwareException) { // <------------------- Also want to catch NoSuchMethod and NoSuchField exception here
coreMessages.unsupportedServerSoftware(e.feature).sendToSender(sender)
return true
} catch (e: Throwable) {
coreMessages.errorExecutingCommand(sender, e).sendToSender(sender)
logger.log(Level.SEVERE, "Error executing command ${info.name}", e)
return true
}
}
looks like you got that from baeldung lol
the multicatch thing?
that's from chatgpt
chatgpt only suggested to do stm like this but then I have to rethrow the exception and I dont like that because it makes no sense
} catch (e: Throwable) {
when(e) {
is UnsupportedServerSoftwareException,
is NoSuchMethodException,
is NoSuchFieldError-> {
coreMessages.unsupportedServerSoftware(e).sendToSender(sender)
return true
}
else -> {
throw e
}
}
} catch (e: Throwable) {
coreMessages.errorExecutingCommand(sender, e).sendToSender(sender)
logger.log(Level.SEVERE, "Error executing command ${info.name}", e)
return true
}
i forgot kotlin doesnt have | for exception params
how can i check how mutch files is in my package?
yeah that's pretty annoying 🥲
extract your .jar and run find | wc
?paste
Usage: !verify <forums username>
could write your multiCatch a bit shorter as return runCatching(this).map { then() }.getOrThrow() though
i get error on eu.podkladson.commands.size()
why do you even need to check it at runtime?
so how can i do that
loop over PluginDescriptionFile#getCommands() https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/PluginDescriptionFile.html#getCommands()
declaration: package: org.bukkit.plugin, class: PluginDescriptionFile
dont talk to me femboy
it doesnt solve the issue completely
why not?
what about he uses custom class for commands, or he needs to iterate through entire package, not only commands?
are you najlex? @tender shard
then one has to use reflection and either check the classloader or the .jar file itself
am I what?
can i just use lombok?
no. if you really want to get all classes of ac ertain package, you'll have to open your jar as ZipInputStream and loop over its entries, e.g. like this https://github.com/mfnalex/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ClassUtils.java#L123
then you can limit it to certain packages by just filtering the result by startsWith("my.package")
next thing to do is to rewrite it in kotlin
fun listAllClasses(clazz: Class<*>): List<String> {
val source = clazz.protectionDomain.codeSource ?: return emptyList()
val url: URL = source.location
try {
ZipInputStream(url.openStream()).use { zip ->
val classes: MutableList<String> = ArrayList()
while (true) {
val entry = zip.nextEntry ?: break
if (entry.isDirectory) continue
val name = entry.name
if (name.endsWith(".class")) {
classes.add(name.replace('/', '.').substring(0, name.length - 6))
}
}
return classes
}
} catch (exception: IOException) {
return emptyList()
}
}
you can do that 1000 times easier
and how?
also, youi can use library for that
also it has a lot of boilerplate
using the system classloader won't work obviously
thats odd, it worked on my machine
works on my machine
plugins are loaded by a separate URLClassLoader
well it worked on my machine
Is your plugin going to be used only in your machine?
i meant to say the whole library, and make it java interoperable
Well you can plainly swap out the classloader
I believe all URL Classloaders support this feature by default
Hey I was wondering if it was possible to have a plugin active again as I want to continue its development but was unable for a year
But I have never used it myself as I am the guy to prefer massive amounts of mass ASM
Are you referring to a premium plugin?
Yes !
Then I have no experience with that
Okay 🙂
It probably is possible though I just cannot say anything on the how
doubt it. calling getResourceAsStream on some package name that comes from your plugin, on the System class loader, will just get you an NPE
prove me
[21:25:50] [Server thread/INFO]: [Basics/Core/BasicsPluginImpl] Showing all classes in pacakge com.github.spigotbasics:
[21:25:50] [Server thread/ERROR]: Error occurred while enabling Basics v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: getResourceAsStream(...) must not be null
at com.github.spigotbasics.plugin.BasicsPluginImpl.findAllClassesUsingClassLoader(BasicsPluginImpl.kt:155) ~[?:?]
at com.github.spigotbasics.plugin.BasicsPluginImpl.onEnable(BasicsPluginImpl.kt:96) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:541) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:455) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:623) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:409) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:250) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1000) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4039-Spigot-c198da2-4c687f2]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
override fun onEnable() {
logger.info("Showing all classes in pacakge com.github.spigotbasics:")
findAllClassesUsingClassLoader("com.github.spigotbasics").forEach(System.out::println)
}
fun findAllClassesUsingClassLoader(packageName: String): Set<Class<*>?> {
val stream: InputStream = ClassLoader.getSystemClassLoader()
.getResourceAsStream(packageName.replace("[.]".toRegex(), "/"))
val reader = BufferedReader(InputStreamReader(stream))
return reader.lines()
.filter({ line: String -> line.endsWith(".class") })
.map({ line: String ->
getClass(
line,
packageName
)
})
.collect(Collectors.toSet())
}
private fun getClass(className: String, packageName: String): Class<*>? {
try {
return Class.forName(
packageName + "."
+ className.substring(0, className.lastIndexOf('.'))
)
} catch (e: ClassNotFoundException) {
// handle the exception
}
return null
}
here
What prevents you from using your plugin classloader though?
nothing, I have only copy/pasted the code they sent, to show them that it won't work like that
it might work fine with the actual plugin classloader, i dont know
Yeah, but once you use the plugin classloader is works fine
nah now it's an empty list
Hm, lemme check for myself
why no openCartographyTable in spigot 🥲
didnt someone here rewrite some inventory API or sth?
Okay I can affirm that URLClassloader will only check the classpath, but not it's URL classpath.
Intriguingly, attempting to list the files of a non-existing folder will not work, so it obviously does some checking
That being said I only tested it with SLL's classloading system (which in turn is based on minestom's classloading) so bukkit might handle it differently, but I'd be surprised
But now that begs the question why I have seen this approach in the wild in earlier days...
maybe it works on a JarClassLoader
yeah anyway, their above mentioned "works on my machine" is bullshit lol
What are ya guys talking about
#help-development message this and following
JarClassLoader is not a thing, no?
Can we please get less kotlin, my brain isn't a kotlin compiler (yet)
yet 🔫
Well, you see, learning another jvm lang is probably easier than learning another anythingelse lang
https://github.com/Perotins/PlayerChannels/blob/master/src/main/java/me/perotin/playerchannels/commands/PlayerChannelsCommand.java Command class that I think is causing my command timing to skyrocket
all the sendConfigMsg, etc (not super uniform, but basically any message is always calling getString eventually)
Which part of the command specifically is causing issues? Because the only part specifically that I can see that would be problematic is your sendClickableCommand() method which creates a new ChannelFile object each time it's invoked, which then calls a YamlConfiguration#loadConfiguration() in the constructor. You're re-reading that file synchronously 8 times
Any other place you're using sendConfigMsg() shouldn't be a problem because you're creating a single ChannelFile object and referencing that one
I'm unsure why you're making a new instance of ChannelFile on line 298 anyways. You can re-use your messages field like you're doing everywhere else
The thing is I'm not sure really what the issue is, I just figured doing all the reads could be a reason but the command is continuous meaning it then opens a lot of menus etc so it could be something later on if that is included in the command timings? Not too familiar with what the command timings means under the hood. And yeah I'll take your suggestion, Here is my timings report with just the plugin on https://imgur.com/a/cWlqDj5
Also just added plugin messages for bungeecord, which can send a fair amount of data
But I feel like a leak somewhere is more probable
A more thorough profiling tool would be Spark
Gives you more precise method calls
I say make the adjustment in your sendClickableCommand() method and that will probably at least tackle one issue, but once you've done that, install Spark and run a profiler with /spark profiler start, run the command a few times, do whatever is causing performance issues, /spark profiler stop and paste the link here
(or /spark profiler start --timeout 60 to timeout after 60 seconds automatically)
hmm why don't my .jars show up in stacktraces?
Second line should be my plugins .jar, and first line is a .jar I'm loading with a custom URLClassLoader
I don't actually know what actually causes that line to show up
Ah, it's moduleName and moduleVersion I assume
actually no, the module would be prefixed, not suffixed
Under logback that string is computed via https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/spi/PackagingDataCalculator.java#L163-L185
Hello party people. So, with my raycasting algorithm, I have been using this cute line of code: java if((int) current.getX() == current.getX() || (int) current.getY() == current.getY() || (int) current.getZ() == current.getZ()) { .... }
Now, the issue is, that I just noticed that this does not give me any RayCast-Results as it skips over the blocks. How may I detect if it hits a block? Current is just the current location of the ray. Check: java Material material = location.getWorld().getBlockAt(current).getType(); if(material != Material.AIR && material != Material.WATER && material != Material.LAVA) { return new RayCastResult(RCType.block, current, null, null); } }
weird. When I throw the same exception on paper, I at least get a .jar location for my plugin itself, but still none for the .jars I loaded myself - any idea on how to make this possible? (I'm just extending URLClassLoader, nothing special https://github.com/SpigotBasics/basics/blob/main/core/src/main/kotlin/com/github/spigotbasics/core/module/loader/ModuleJarClassLoader.kt)
I'm looking into it given that my own classloader doesn't suppor this feature either from the looks of it
You know there are raycasting methods in Bukkit right? 
There was a valid reason why I didn't use them, I don't remember tho
idk if it was that it does not work with how I need the raycasting or the performance, maybe both
Well, if nothing else, you should probably just use a BlockIterator instead because it seems you're wanting to accomplish the same goal
the Algorithm does not only respect blocks
Well different blocks have different shapes
for (Entity entity : nearbyEntities) {
if(entity instanceof Player && !entity.getUniqueId().equals(this.shooter.getUniqueId())) {
SegmentedHitbox.hitboxes.get((Player)entity).update();
EHitboxSegment isInside = SegmentedHitbox.hitboxes.get((Player)entity).isInside(current.getX(), current.getY(), current.getZ());
if(isInside != null) {
return new RayCastResult(RCType.entity, current, (Player)entity, isInside);
}
}
}``` see this for example
you know bukkit has a raycast method that works for both blocks and entities right
I know
^
I am 100% sure that I had a valid reason to not use it
you're just not sure what the reason is
yeah because I wrote that stuff a year ago
meanwhile at work I'm responsible for coming up with a minigame network (single game for now) that can handle 400 people
development time: 9 days
👀 It's been a year. Maybe it's time to re-try it?
Could be perhaps you were missing the ray size parameter? I think that was only a somewhat recent addition
I won't screw over the logics I wrote in like 100 hours for a 10% chance that it works with a builtin method lmao
That's what version control is for
for now, I'd just prefer to somehow manage a solution for the thing I was asking
I'm not convinced this condition will ever be true
(int) current.getX() == current.getX() || (int) current.getY() == current.getY() || (int) current.getZ() == current.getZ()
I honestly don't even know what you're trying to do
yeah that's exactly the issue
idk why I did this, but yeah
the raycast fully works when removing it, but then it takes 45873753275737757 hours to process

bc it checks.... a lot more
@tender shard At least in the case of logback this issue is caused by logback computing the packaging data by classloading the class via the wrong classloader. Bukkit probably has it's own classloader as the Thread's context classloader and as such for bukkit things it still works.
I somehow just need to snap it to the BoundingBox of a Block
hm isn't the filename part of the StackTraceElement?
Yep, setting the context classloader fix the issue in the case of SLL so it is almost defo caused by that. At least for me; spigot is using Log4J so stuff may differ, but I'd not be surprised
That is the MyClass.kt filename
Yeah I got caught offguard too at first heh
Though uh honestly this makes this feature pretty useless (unless people don't name their packages correctly) so I can see why this is not enabled by default in logback world
Hi
Hi
Im creating water rising command beetwen two locations but it does the task 3 times fast and then normally, can some1 look at my code?
?paste
apart from code style that looks alright to me
but when i start it, it rise 3 blocks and then 1 block every sec
is it doing 1 block 3 times in a fast manner or is it 3 blocks instant?
which type did it have?
I don't find anything about ChannelPipeline in older mappings (went back to 1.16.5)
if you tell me in which version entityPlayer.playerConnection.networkManager.channel.pipeline() worked, I can probably find out what the today-version is
can you show me the locations in your config?
sure
pos1:
==: org.bukkit.Location
world: world
x: 12.699999988079071
y: -61.0
z: 5.699999988079071
pitch: 41.28115
yaw: -35.72702
pos2:
==: org.bukkit.Location
world: world
x: 10.300000011920929
y: -61.0
z: 3.300000011920929
pitch: 41.28115
yaw: -35.72702```
pos1.setY(pos1.getY() + 1);
pos2.setY(pos2.getY() + 1);
I don't get these lines - why do you do +1 and then +1 again later? That's probably the issue
You are not changing the location in your config so you have the same result on each call
ServerPlayer (NMS) -> connection field, returns ServerGamePacketListenerImpl
ServerGamePacketListenerImpl is a super class of ServerCommonPacketListenerImpl, which has a field "connection" = Connection object
Connection has a field "channel" that's a io.netty.channel.Channel - this one should have your pipeLine() method
@solar musk
but after 3 blocks it starts working
are you not using the mappings website?
well I just Ctrl+F through it and if I don't find something, I check the super classes and repeat there
Can i send u video?
depends - it's protected in ServerCommonPacketListenerImpl
yeah it's protected, you'd have to extend ServerGamePacketListenerImpl if you don't want to use reflection
Sure you can but I would not tamper with the Location from the config. You should not change it during your rising water
This will not work
you're getting the field by name, but the actrual name is obfuscated
you're better off getting the field by its return type
sth like
for(Field field : ServerGamePacketListenerImpl.class.getDeclaredFields()) {
if(field.getType() == Connection.class) // This is the correct field
that could work but then you have to update it for each new version
this works universally - unless they ever decide to add a second "Connection" type field, but in that case, as coll said, you could add an index to get your getField method
it's automatic dude
give me a .jar, I run allatori twice - will be the same .jar but everytrhing has different names
I think that mojang also doesn't actually change the settings or make it random, but whatever a field is called depends on the "how manyth" field it is.
stupidly said: first field is a, second is b, etc.
Now if they add a field between a and b, then b will ofc be c now
that's why it's more reliable to check by return type if you can't directly access a field (because of private, protected, whatever)

