From 31b3acdba7cd3d1403782fdbc7910f4a53083eda Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Wed, 11 Dec 2019 20:36:47 +0100 Subject: [PATCH] acknowledge player digging --- .../Protocol1_14_3To1_14_4.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_3to1_14_4/Protocol1_14_3To1_14_4.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_3to1_14_4/Protocol1_14_3To1_14_4.java index ace42601..e8f04227 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_3to1_14_4/Protocol1_14_3To1_14_4.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_14_3to1_14_4/Protocol1_14_3To1_14_4.java @@ -13,7 +13,18 @@ public class Protocol1_14_3To1_14_4 extends BackwardsProtocol { @Override protected void registerPackets() { // Acknowledge Player Digging - added in pre4 - cancelOutgoing(State.PLAY, 0x5C); + registerOutgoing(State.PLAY, 0x5C, 0x0B, new PacketRemapper() { + @Override + public void registerMap() { + map(Type.POSITION1_14); + map(Type.VAR_INT); + handler(wrapper -> { + int status = wrapper.read(Type.VAR_INT); + boolean allGood = wrapper.read(Type.BOOLEAN); + if (allGood && status == 0) wrapper.cancel(); + }); + } + }); // Trade list registerOutgoing(State.PLAY, 0x27, 0x27, new PacketRemapper() { @@ -45,6 +56,5 @@ public class Protocol1_14_3To1_14_4 extends BackwardsProtocol { } @Override - public void init(UserConnection userConnection) { - } + public void init(UserConnection userConnection) {} }