Issues with DataWatcher in the latest Spigot/Paper on TNT Minecarts
libraryaddict opened this issue · 2 comments
Attempting to call WrappedDataWatcher.getEntityWatcher
using a nms entity is throwing a nper. I believe this is only for the TNT minecart.
I'm pretty tired, but it looks like this change is responsible.
If you don't care to log into the site, that's fine. It only seems to have changed the constructor of the entity and made a field public from private. Checked ingame and tnt minecarts are working as expected with vanilla spawned. All entities are spawned the same way, and its loading the other minecarts fine. Just noti this for some reason.
I haven't tried a spigot with that change reverted, last time I tried to mess with spigot src I wasted a few hours and I'm not keen to re-experience it.
This build of Lib's Disguises isn't special beyond logging what disguise type its trying to load, and printing the datawatcher.
https://drive.google.com/file/d/1d2Howb8IfMjssBKXv_-Ohtr6YTDzQMxj/view?usp=share_link
But anyways, its just a headache. Hoping you'll have a better idea because it doesn't make sense to me.
[18:07:57] [Server thread/ERROR]: Error occurred while enabling LibsDisguises v10.0.32-SNAPSHOT (Is it up to date?)
java.lang.IllegalStateException: Unable to read field value of protected final net.minecraft.network.syncher.DataWatcher net.minecraft.world.entity.Entity.am
at com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor.get(DefaultFieldAccessor.java:30) ~[?:?]
at com.comphenix.protocol.wrappers.WrappedDataWatcher.getEntityWatcher(WrappedDataWatcher.java:553) ~[?:?]
at me.libraryaddict.disguise.utilities.reflection.ReflectionManager.createNMSValues(ReflectionManager.java:2397) ~[?:?]
at me.libraryaddict.disguise.utilities.reflection.ReflectionManager.registerValues(ReflectionManager.java:2235) ~[?:?]
at me.libraryaddict.disguise.LibsDisguises.onEnable(LibsDisguises.java:256) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-api-1.19.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugin(CraftServer.java:533) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at org.bukkit.craftbukkit.v1_19_R3.CraftServer.enablePlugins(CraftServer.java:447) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:589) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:414) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:250) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:975) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.19.4-R0.1-SNAPSHOT.jar:3721-Spigot-d2fdfe3-19de355]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?]
at java.lang.invoke.DirectMethodHandle.checkBase(DirectMethodHandle.java:566) ~[?:?]
at com.comphenix.protocol.reflect.accessors.DefaultFieldAccessor.get(DefaultFieldAccessor.java:28) ~[?:?]
... 15 more```
PaperMC/Paper@7fe34e9 - we hit this one a while ago in paper, was the fix for it on our side to not break the expectations here