From 69ffff35d3cf54450f447b710d18865ff472af31 Mon Sep 17 00:00:00 2001 From: Exterminate Date: Sun, 18 Oct 2026 11:00:02 +1100 Subject: [PATCH] Block breaking --- .../viabedrock/protocol/packet/ClientPlayerPackets.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/raphimc/viabedrock/protocol/packet/ClientPlayerPackets.java b/src/main/java/net/raphimc/viabedrock/protocol/packet/ClientPlayerPackets.java index c3f5e1ff0..7704e2189 100644 --- a/src/main/java/net/raphimc/viabedrock/protocol/packet/ClientPlayerPackets.java +++ b/src/main/java/net/raphimc/viabedrock/protocol/packet/ClientPlayerPackets.java @@ -324,7 +324,6 @@ protected void register() { clientPlayer.cancelNextSwingPacket(); clientPlayer.setBlockBreakingInfo(new ClientPlayerEntity.BlockBreakingInfo(position, direction)); // TODO: Handle instant breaking - // TODO: Handle creative mode mining // TODO: Test breaking fire // TODO: The java client keeps spamming swing packets while waiting for the block break cooldown. Those need to be cancelled @@ -351,6 +350,10 @@ protected void register() { chunkTracker.handleBlockChange(position, 0, chunkTracker.bedrockAirId()); PacketFactory.sendJavaBlockUpdate(wrapper.user(), position, ProtocolConstants.JAVA_AIR_ID); } + case CHANGE_DESTROY_DIRECTION -> { + clientPlayer.setBlockBreakingInfo(new ClientPlayerEntity.BlockBreakingInfo(position, direction)); + clientPlayer.addAuthInputBlockAction(new ClientPlayerEntity.AuthInputBlockAction(PlayerActionType.ContinueDestroyBlock, position, direction.ordinal())); + } case SWAP_ITEM_WITH_OFFHAND, STAB -> { } default -> throw new IllegalStateException("Unhandled PlayerActionAction: " + action);