NBT-API

NBT-API

98.9k Downloads

Add support for 1.17.1

CC007 opened this issue ยท 10 comments

commented

I use the NBT api in my plugin. My users get this error in 1.17.1:

[12:46:12] [Server thread/INFO]: [NBTAPI] [NBTAPI] Found Spigot: v1_17_R1! Trying to find NMS support
[12:46:12] [Server thread/WARN]: [NBTAPI] [NBTAPI] Wasn't able to find NMS Support! Some functions may not work!
[12:46:12] [Server thread/INFO]: [NBTAPI] [NBTAPI] Found Gson: class com.google.gson.Gson
[12:46:12] [Server thread/WARN]: [NBTAPI] [NBTAPI] Error while trying to resolve the class 'NBTBase'!
java.lang.ClassNotFoundException: net.minecraft.server.v1_17_R1.NBTBase

Could you update the plugin for 1.17.1?

Also could you try to make the plugin compatible for future versions using reflection (maybe with a warning for versions that aren't officially tested yet)?

commented

You need 2.8.0+ of the api for 1.17. Also it uses reflections, but 1.17 changed the entire package structure so nothing works.

maybe with a warning for versions that aren't officially tested yet

Wasn't able to find NMS Support! Some functions may not work!

commented

This might be because of the java 16 requirement. You can use --illegal-access=warn --add-opens java.base/java.lang.invoke=ALL-UNNAMED for that.

commented

I was using 2.8.0, but that seemed to only work with 1.17, not 1.17.1

commented

No, your issue is that you have a version < 2.8.0. That's why it tries to find the NBTBase class at net.minecraft.server.v1_17_R1.NBTBase and not net.minecraft.nbt.NBTBase where it is in 1.17.

commented

afbeelding

commented

You are shading the api, then really check your files. https://github.com/tr7zw/Item-NBT-API/blob/master/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/MinecraftVersion.java#L20 2.8.0 or 2.8.1-SNAPSHOT both support 1.17.0/1.17.1.

commented

I think something went wrong when I built it. I rebuilt it and now it seems to work fine. Thanks for your help!

commented

Yea I figured that something like that went wrong (wrong jar, didn't restart correctly, didn't save pom after changing, didn't rebuilt correctly). Nothing feels worse than trying stuff for half an hour till you notice that the changes weren't applying ๐Ÿ˜…

commented

Also love your quick responses. If I ever have issues again, I know where to find you. Do you also have a discord channel?