diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/BedrockCodecHelper_v712.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/BedrockCodecHelper_v712.java index d81c15e12..1e1f79e43 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/BedrockCodecHelper_v712.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/BedrockCodecHelper_v712.java @@ -133,6 +133,7 @@ public void writeItemUse(ByteBuf buffer, InventoryTransactionPacket packet) { this.writeVector3f(buffer, packet.getPlayerPosition()); this.writeVector3f(buffer, packet.getClickPosition()); VarInts.writeUnsignedInt(buffer, packet.getBlockDefinition().getRuntimeId()); + VarInts.writeUnsignedInt(buffer, packet.getClientInteractPrediction().ordinal()); } @Override @@ -146,6 +147,7 @@ public void readItemUse(ByteBuf buffer, InventoryTransactionPacket packet) { packet.setPlayerPosition(this.readVector3f(buffer)); packet.setClickPosition(this.readVector3f(buffer)); packet.setBlockDefinition(this.blockDefinitions.getDefinition(VarInts.readUnsignedInt(buffer))); + packet.setClientInteractPrediction(ItemUseTransaction.PredictedResult.values()[VarInts.readUnsignedInt(buffer)]); } protected void writeFullContainerName(ByteBuf buffer, FullContainerName containerName) { diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java index 5b32f6ae0..7b35139a9 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/packet/InventoryTransactionPacket.java @@ -52,6 +52,11 @@ public class InventoryTransactionPacket implements BedrockPacket { */ private ItemUseTransaction.TriggerType triggerType; + /** + * @since v712 + */ + private ItemUseTransaction.PredictedResult clientInteractPrediction; + @Override public final PacketSignal handle(BedrockPacketHandler handler) { return handler.handle(this);