Alvin-LB / NameTagChanger

Library to be shaded into Bukkit Plugins to allow for modification of player name tags.
MIT License
31 stars 10 forks source link

Unable to change player name with 1.15.1 #13

Open SimonIT opened 4 years ago

SimonIT commented 4 years ago

This exception is thrown if changePlayerName or updatePlayer is executed

org.bukkit.command.CommandException: Unhandled exception executing 'changeidentity:changeidentity peter_roelle' in de.simonit.changeidentity.commands.ChangeIdentityCommand(changeidentity)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:690) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1606) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1460) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(SourceFile:36) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(SourceFile:9) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.MinecraftServer.aZ(MinecraftServer.java:875) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:868) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:852) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:792) [craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_15_R1.DataWatcher exists in class PacketPlayOutNamedEntitySpawn.
    at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:363) ~[?:?]
    at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:343) ~[?:?]
    at com.bringholm.nametagchanger.ProtocolLibPacketHandler.sendNamedEntitySpawnPacket(ProtocolLibPacketHandler.java:140) ~[?:?]
    at com.bringholm.nametagchanger.NameTagChanger.updatePlayer(NameTagChanger.java:283) ~[?:?]
    at com.bringholm.nametagchanger.NameTagChanger.changePlayerName(NameTagChanger.java:152) ~[?:?]
    at de.simonit.changeidentity.commands.ChangeIdentityCommand.execute(ChangeIdentityCommand.java:53) ~[?:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148) ~[craftbukkit-1.15.1-R0.1-SNAPSHOT.jar:git-Bukkit-2d9db47]
    ... 16 more

@Alvin-LB

SimonIT commented 4 years ago

It seems, that Mojang removed data watchers from the packet in 1.15 dmulloy2/ProtocolLib#738 It would be nice if the plugin would be made compatible with this change

Alvin-LB commented 4 years ago

NameTagChanger needs to be reworked as soon as Mojang changes the packet internals (which happens every few versions). I have not had the time to update this after 1.12.

I can probably fix this, but I cannot say when I will have the time to do so.

kylematzen commented 4 years ago

I'll look into it, but no promises.