com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_16_R2.ItemStack exists in class PacketPlayOutEntityEquipment.
alexandrage opened this issue · 3 comments
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_16_R2.ItemStack exists in class PacketPlayOutEntityEquipment.
at com.comphenix.protocol.reflect.StructureModifier.writeInternal(StructureModifier.java:363) ~[?:?]
at com.comphenix.protocol.reflect.StructureModifier.write(StructureModifier.java:343) ~[?:?]
at com.comphenix.packetwrapper.WrapperPlayServerEntityEquipment.setItem(WrapperPlayServerEntityEquipment.java:109) ~[?:?]
Actually, I get a different error: No field with type net.minecraft.server.v1_16_R2.EnumItemSlot exists in class PacketPlayOutEntityEquipment.
And indeed, the protocl has changed:
private int a;
private final List<Pair<EnumItemSlot, ItemStack>> b;
Not sure if ProtocolLib supports Pair at all, I'll check that
Edit: okay, we need to wait that dmulloy2/ProtocolLib@f19bfc6 is deployed as a Snapshot.
The other question is, whether the regeneration script should be ran or whether this code change should be done manually?
This works for block setting yes getSlotStackPairLists
The other question is, whether the regeneration script should be ran or whether this code change should be done manually?
As I am aware, the work on new format support is done manually.
This exact fix is partly available here: #78 (although the PR seems to be incorrect as write operations seem to be missing).
Also it should be available as part of this changeset: #60 (lazily, but I am working on it as I now have some sponsoring for it).
As a temporary workaround you can either do these operations directly by modifying the underlying PacketContainer manually or either add the Draft-PR branch as a git submodule and use it for building.