ProtocolLib

3M Downloads

Writing to getDimension() no longer works as expected

jaypitti opened this issue · 9 comments

commented
	PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.RESPAWN);
        packet.getDimensions().writeSafely(0, 1);

org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:2186) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:32) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:941) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:934) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:918) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:850) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.lang.IllegalArgumentException: Unable to find a method that matches {modifiers=[required: 1000, banned: 0], return=Exact class net.minecraft.server.v1_16_R2.DimensionManager, params=[{Type: Exact int, Index: null}]}
        at com.comphenix.protocol.reflect.FuzzyReflection.getMethod(FuzzyReflection.java:174) ~[?:?]
        at com.comphenix.protocol.wrappers.BukkitConverters$19.getGeneric(BukkitConverters.java:1148) ~[?:?]
        at com.comphenix.protocol.wrappers.BukkitConverters$19.getGeneric(BukkitConverters.java:1136) ~[?:?]
        at com.comphenix.protocol.wrappers.Converters$1.getGeneric(Converters.java:44) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:370) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:343) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.writeSafely(StructureModifier.java:408) ~[?:?]
        at net.stephcraft.zombiecraft.items.tools.DimensionTool.createDimensionSwitch(DimensionTool.java:171) ~[?:?]
        at net.stephcraft.zombiecraft.items.tools.DimensionTool.onInventoryClickEvent(DimensionTool.java:151) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]

https://pastebin.com/VMrqxGZ7

commented
commented

Update ProtocolLib.

Related to #893

commented

I just downloaded the latest today, ill re download and and let and post an update here

commented

still present

commented

sorry im blind now its


org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:2186) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:32) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:941) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:934) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:918) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:850) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_16_R2.ResourceKey exists in class PacketPlayOutRespawn.
        at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:365) ~[?:?]
        at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:345) ~[?:?]
        at net.stephcraft.zombiecraft.items.tools.DimensionTool.createDimensionSwitch(DimensionTool.java:174) ~[?:?]
        at net.stephcraft.zombiecraft.items.tools.DimensionTool.onInventoryClickEvent(DimensionTool.java:154) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot-1.16.2.jar:git-Spigot-379750e-43c7ff9]
        ... 18 more


commented

After looking at the docs a little, looks like the data type may have changed again between 1.16.1 to 1.16.2

commented

please post the full exception

commented

Wow they really reverted the change from 1.15 to 1.16.1. Okay this requires some code changes in ProtocolLib.

EDIT: To be clear, they only reverted the dimension manager field. World is still a ResourceKey.

commented

that's...really annoying

i'll look into it tomorrow