NBTInjector not working for 1.16.1
Yeetmeisterr opened this issue ยท 2 comments
The rest of NBTAPI works, but for some reason, injecting with NBTInjector gives me an error, and the parts of the plugin that use non-vanilla tags for entities no longer work. The plugin was updated to 1.16.1 recently, and I use PaperMC. The version that I put into maven is 2.4.1, and the NBTAPI jar file itself is 2.4.1.
Error when loading:
[NBTInjector] [NBTINJECTOR] Injecting Entity classes...
15.07 12:37:28 [Server] INFO [NBTAPI] [NBTAPI] Found Spigot: v1_16_R1! Trying to find NMS support
15.07 12:37:28 [Server] INFO [NBTAPI] [NBTAPI] NMS support 'MC1_16_R1' loaded!
15.07 12:37:28 [Server] INFO [NBTAPI] [NBTAPI] Using the plugin 'LuckPerms' to create a bStats instance!
15.07 12:37:29 [Server] ERROR [org.bukkit.craftbukkit.v1_16_R1.CraftServer] java.lang.NoSuchFieldException: ba initializing Merchants v1.0-SNAPSHOT (Is it up to date?)
15.07 12:37:29 [Server] INFO de.tr7zw.nbtapi.NbtApiException: java.lang.NoSuchFieldException: ba
15.07 12:37:29 [Server] INFO at de.tr7zw.nbtinjector.NBTInjector.inject(NBTInjector.java:74) ~[?:?]
15.07 12:37:29 [Server] INFO at me.yeetmeister.onetree.merchants.Merchants.onLoad(Merchants.java:36) ~[?:?]
15.07 12:37:29 [Server] INFO at org.bukkit.craftbukkit.v1_16_R1.CraftServer.loadPlugins(CraftServer.java:393) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:29 [Server] INFO at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:208) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:29 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:940) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:29 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:29 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
15.07 12:37:29 [Server] INFO Caused by: java.lang.NoSuchFieldException: ba
15.07 12:37:29 [Server] INFO at java.lang.Class.getDeclaredField(Class.java:2070) ~[?:1.8.0_211]
15.07 12:37:29 [Server] INFO at de.tr7zw.nbtinjector.InternalInjectors.entity1v14(InternalInjectors.java:174) ~[?:?]
15.07 12:37:29 [Server] INFO at de.tr7zw.nbtinjector.NBTInjector.inject(NBTInjector.java:62) ~[?:?]
15.07 12:37:29 [Server] INFO ... 6 more
Code used to inject:
@OverRide
public void onLoad() {
NBTInjector.inject();
}
Error when enabling:
[NBTAPI] Enabling NBTAPI v2.4.1
15.07 12:37:41 [Server] INFO [NBTAPI] Adding listeners...
15.07 12:37:41 [Server] INFO [NBTAPI] Checking bindings...
15.07 12:37:41 [Server] WARN [NBTAPI] Loaded class de.tr7zw.nbtapi.utils.MinecraftVersion from Merchants v1.0-SNAPSHOT which is not a depend, softdepend or loadbefore of this plugin.
15.07 12:37:41 [Server] INFO [NBTAPI] Gson:
15.07 12:37:41 [Server] INFO [NBTAPI] [NBTAPI] Found Gson: class com.google.gson.Gson
15.07 12:37:41 [Server] INFO [NBTAPI] All Classes were able to link!
15.07 12:37:41 [Server] INFO [NBTAPI] All Methods were able to link!
15.07 12:37:41 [Server] INFO [NBTAPI] Running NBT reflection test...
15.07 12:37:42 [Server] INFO [NBTInjector] Entity wasn't the correct class! 'net.minecraft.server.v1_16_R1.EntityZombie'
15.07 12:37:42 [Server] WARN [NBTAPI] Error during 'EntityCustomNbtInjectorTest' test!
15.07 12:37:42 [Server] INFO de.tr7zw.nbtapi.NbtApiException: Wasn't able to use NBTEntities!
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.tests.injector.EntityCustomNbtInjectorTest.test(EntityCustomNbtInjectorTest.java:36) ~[?:?]
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.NBTAPI.onEnable(NBTAPI.java:144) ~[?:?]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugin(CraftServer.java:500) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugins(CraftServer.java:414) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.loadWorld(MinecraftServer.java:471) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:241) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:940) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
15.07 12:37:42 [Server] INFO Caused by: java.lang.NullPointerException
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.tests.injector.EntityCustomNbtInjectorTest.test(EntityCustomNbtInjectorTest.java:27) ~[?:?]
15.07 12:37:42 [Server] INFO ... 11 more
15.07 12:37:42 [Server] INFO [NBTInjector] Entity wasn't the correct class! 'net.minecraft.server.v1_16_R1.EntityArmorStand'
15.07 12:37:42 [Server] WARN [NBTAPI] Error during 'SpawnEntityCustomNbtInjectorTest' test!
15.07 12:37:42 [Server] INFO de.tr7zw.nbtapi.NbtApiException: Wasn't able to use NBTEntities!
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.tests.injector.SpawnEntityCustomNbtInjectorTest.test(SpawnEntityCustomNbtInjectorTest.java:36) ~[?:?]
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.NBTAPI.onEnable(NBTAPI.java:144) ~[?:?]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugin(CraftServer.java:500) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugins(CraftServer.java:414) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.loadWorld(MinecraftServer.java:471) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:241) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:940) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-91]
15.07 12:37:42 [Server] INFO at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
15.07 12:37:42 [Server] INFO Caused by: java.lang.NullPointerException
15.07 12:37:42 [Server] INFO at de.tr7zw.nbtapi.plugin.tests.injector.SpawnEntityCustomNbtInjectorTest.test(SpawnEntityCustomNbtInjectorTest.java:27) ~[?:?]
15.07 12:37:42 [Server] INFO ... 11 more
15.07 12:37:42 [Server] INFO [NBTAPI] EntityCustomNbtPersistentTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] RemovingKeys: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] EqualsTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] SubCompoundsTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] TilesCustomNBTInjectorTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] EntityCustomNbtInjectorTest: Wasn't able to use NBTEntities!
15.07 12:37:42 [Server] INFO [NBTAPI] NBTFileTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] TilesCustomNBTPersistentTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] EntityTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] MergeTileSubCompoundTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] ItemConvertionTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] GameprofileTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] MergeTest: Ok
15.07 12:37:42 [Server] INFO [NBTAPI] TypeTest: Ok
15.07 12:37:44 [Multicraft] Skipped 86 lines due to rate limit (50/s)
I tested it on a blank plugin just to make sure that I wasn't messing something up, and the same thing happens. Everything else works in the plugin, but anything regarding non-vanilla tags does not work.
As stated, the nbt-injector will not be updated for 1.16+ since it's not needed anymore. With the next release it will print the correct message when trying to enable it on 1.16.1 (https://github.com/tr7zw/Item-NBT-API/blob/master/nbt-injector/src/main/java/de/tr7zw/nbtinjector/NBTInjector.java#L51). Please use the persistent storage API that was added to NBT Tiles/Entities for 1.14+.