From ff53d30a7e16f31138257f5377a0f779f16c8299 Mon Sep 17 00:00:00 2001 From: paulaboks Date: Wed, 7 Oct 2026 17:32:14 -0300 Subject: [PATCH] Reset breaking progress when changing blocks --- client/game_mode.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/game_mode.ts b/client/game_mode.ts index 390083f..2c56776 100644 --- a/client/game_mode.ts +++ b/client/game_mode.ts @@ -36,6 +36,11 @@ export class MultiPlayerGameMode { const block_info = EverythingRegistry.get_by_id("blocks", hit.block)!; const tool = this.#held_item()?.tool; + // looking at another block starts it over + const pos = this.destroy_pos; + if (!pos || pos.x !== hit.x || pos.y !== hit.y || pos.z !== hit.z) { + this.destroy_progress = 0; + } this.destroy_pos = { x: hit.x, y: hit.y, z: hit.z }; this.destroy_time = block_info.toughness ?? 9999; this.destroy_progress += TICK_DELTA * (tool && tool.type === block_info.tool_to_break ? tool.speed : 1);