diff options
| author | Marlian <84173858+MCbabel@users.noreply.github.com> | 2026-03-06 01:25:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 07:25:37 +0700 |
| commit | f012250219abcdb0d07cd60ca2089fbb63dc222c (patch) | |
| tree | 6b1f124e9d464487eda453a107031a765f868c3c | |
| parent | 5d544bcb837531bb31dd517a0ff3a4a55a646f8e (diff) | |
Fix creative mode double block break on single click (#640)
| -rw-r--r-- | Minecraft.Client/MultiPlayerGameMode.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Minecraft.Client/MultiPlayerGameMode.cpp b/Minecraft.Client/MultiPlayerGameMode.cpp index 9c4b0795..8cbd1b91 100644 --- a/Minecraft.Client/MultiPlayerGameMode.cpp +++ b/Minecraft.Client/MultiPlayerGameMode.cpp @@ -133,6 +133,9 @@ void MultiPlayerGameMode::startDestroyBlock(int x, int y, int z, int face) if (localPlayerMode->isCreative()) { + // Skip if we just broke a block — prevents double-break on single clicks + if (destroyDelay > 0) return; + connection->send(shared_ptr<PlayerActionPacket>( new PlayerActionPacket(PlayerActionPacket::START_DESTROY_BLOCK, x, y, z, face) )); creativeDestroyBlock(minecraft, this, x, y, z, face); destroyDelay = 5; @@ -178,6 +181,7 @@ void MultiPlayerGameMode::stopDestroyBlock() isDestroying = false; destroyProgress = 0; + destroyDelay = 0; minecraft->level->destroyTileProgress(minecraft->player->entityId, xDestroyBlock, yDestroyBlock, zDestroyBlock, -1); } |
