Creative
This commit is contained in:
+6
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user