This commit is contained in:
2026-11-16 13:39:34 -03:00
parent be0770f3cf
commit 5301e0307c
8 changed files with 74 additions and 9 deletions
+6 -3
View File
@@ -45,7 +45,8 @@ export class MultiPlayerGameMode {
this.destroy_progress = 0;
}
this.destroy_pos = { x: hit.x, y: hit.y, z: hit.z };
this.destroy_time = block_info.toughness ?? 9999;
// blocks without a toughness, like water, can only be broken in creative
this.destroy_time = this.client.player.creative ? 0 : block_info.toughness ?? 9999;
this.destroy_progress += TICK_DELTA * (tool && tool.type === block_info.tool_to_break ? tool.speed : 1);
if (this.destroy_progress >= this.destroy_time) {
@@ -134,8 +135,10 @@ export class MultiPlayerGameMode {
if ((!block_info.interactive || skips_block) && place_id && placeable) {
level.add_block({ ...target, id: place_id }, place_value! >>> 16);
predict_neighbors(target.x, target.y, target.z);
const slot = this.#held_slot();
slot.amount = slot.amount! - 1;
if (!this.client.player.creative) {
const slot = this.#held_slot();
slot.amount = slot.amount! - 1;
}
}
}