ProtocolLib icon indicating copy to clipboard operation
ProtocolLib copied to clipboard

[1.18.2] Holder<DimensionManager> does not translate to a known ProtocolLib StructureModifier

Open ineanto opened this issue 3 years ago • 0 comments

Make sure you're doing the following

  • [x] You're using the latest build for your server version
  • [x] This isn't an issue caused by another plugin
  • [x] You've checked for duplicate issues
  • [x] You didn't use /reload

Describe the question Hi. I'm currently working on a plugin which changes the skin and name of the player. I send a PacketPlayOutRespawn to the player to update the player view of his skin. Unfortunately, I'm unable to create the packet because in 1.18, the a field was changed from DimensionManager to Holder<DimensionManager>:

https://i.imgur.com/JfAYwVH.png

API method(s) used packet.getModifier().writeSafely(0, ?)

Expected behavior I expect the client to not crash and complaining that Holder.a() can't be called because var0 (the a field) is null...

Code

WrapperPacketPlayOutRespawn comes from this Spigot thread: https://www.spigotmc.org/threads/protocollib-create-a-packetplayoutrespawn.469718/

final PacketContainer container = NickoBukkit.getInstance().getProtocolManager().createPacket(PacketType.Play.Server.RESPAWN);
final WrapperPacketPlayOutRespawn respawn = new WrapperPacketPlayOutRespawn(
final World world = player.getWorld();
respawn.setDifficulty(world.getDifficulty());
respawn.setGameMode(player.getGameMode());
respawn.setSeed(world.getSeed());
container.getBooleans().write(1, true);
//respawn.setWorldType(world.getWorldType());
respawn.setWorld(world);
respawn.sendPacket(player);

Thank you to anyone in advance who will help me tackle this issue.

ineanto avatar Apr 03 '22 13:04 ineanto