Hi, I'm in the process of updating some 1.17 code, and I've hit a problem trying to update some ProtocolLib code. I'm trying to properly create a RESPAWN packet, and it seems like I don't understand the new format.
Here are the required packet components inside ClientboundRespawnPacket:
DimensionType[0] - Dimension info
ResourceLocation[0] - Dimension name
Long[0] - World seed
Byte[0] - Player gamemode
Byte[1] - Previous gamemode
Boolean[0] - Is world debug?
Boolean[1] - Is world flat?
Boolean[2] - Keep all player data?
I seem to be failing at the first step, writing a DimensionType. This line 4 fails:
var respawn = new PacketContainer(RESPAWN);
var world = player.getWorld();
respawn.getDimensionTypes().write(0, world);
Error:
FieldAccessException: No field with type net.minecraft.world.level.dimension.DimensionManager exists in class PacketPlayOutRespawn.