PacketWrapper
PacketWrapper copied to clipboard
com.comphenix.protocol.reflect.FieldAccessException: No field with type net.minecraft.server.v1_16_R2.ItemStack exists in class PacketPlayOutEntityEquipment.
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 https://github.com/dmulloy2/ProtocolLib/commit/f19bfc613e589ead899891e4100b77de2100f76e 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: https://github.com/dmulloy2/PacketWrapper/pull/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: https://github.com/dmulloy2/PacketWrapper/pull/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.