From fe845710b65c8ec0a0646f4299b7a65f2cafc8bf Mon Sep 17 00:00:00 2001 From: AJ Ferguson Date: Mon, 30 Sep 2019 14:17:36 -0800 Subject: [PATCH] Fix for block breaking --- .../network/session/GeyserSession.java | 13 ++-- .../bedrock/BedrockActionTranslator.java | 67 +++++-------------- 2 files changed, 21 insertions(+), 59 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java index 5fa40ade8..0b5b32500 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/GeyserSession.java @@ -32,6 +32,7 @@ import com.flowpowered.math.vector.Vector3i; import com.github.steveice10.mc.auth.data.GameProfile; import com.github.steveice10.mc.auth.exception.request.RequestException; import com.github.steveice10.mc.protocol.MinecraftProtocol; +import com.github.steveice10.mc.protocol.data.game.world.block.BlockFace; import com.github.steveice10.packetlib.Client; import com.github.steveice10.packetlib.event.session.ConnectedEvent; import com.github.steveice10.packetlib.event.session.DisconnectedEvent; @@ -64,13 +65,6 @@ import java.util.UUID; @Getter public class GeyserSession implements Player { - @Getter - @Setter - private volatile boolean breaking; - - @Getter - @Setter - private volatile boolean threadStop; private final GeyserConnector connector; private final BedrockServerSession upstream; @@ -101,9 +95,10 @@ public class GeyserSession implements Player { private boolean spawned; private boolean closed; - @Getter @Setter - private Thread breakThread; + private Vector3i blockDiggingPos = Vector3i.ZERO; + @Setter + private BlockFace blockDiggingFace = BlockFace.DOWN; public GeyserSession(GeyserConnector connector, BedrockServerSession bedrockServerSession) { this.connector = connector; diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java index 06f06981f..fdab51ba6 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java @@ -80,69 +80,36 @@ public class BedrockActionTranslator extends PacketTranslator