This commit is contained in:
2026-04-14 10:51:57 -03:00
parent 2568694ada
commit a758037f20
5 changed files with 21 additions and 4 deletions
+2 -2
View File
@@ -138,7 +138,7 @@ export class Dimension extends Component {
) as BlockData<T>;
}
break_block(x: number, y: number, z: number) {
break_block(x: number, y: number, z: number, drop_item: boolean = true) {
const block_chunk_x = Math.floor(x / CHUNK_SIZE);
const block_chunk_z = Math.floor(z / CHUNK_SIZE);
const chunk = this.get_chunk(block_chunk_x, block_chunk_z);
@@ -148,7 +148,7 @@ export class Dimension extends Component {
const block_info = EverythingRegistry.get_by_id<BlockRegistry>("blocks", this.get_block(x, y, z))!;
if (block_info.drop_table) {
if (drop_item && block_info.drop_table) {
const [player] = this.world.get_tag("player")!;
const player_component = player.get(PlayerComponent)!;
player_component.player_inventory.container.add_item(new ItemStack(block_info.drop_table));