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);