Register items for blocks

This commit is contained in:
2026-03-26 11:07:41 -03:00
parent 6e6dd08af7
commit 188b7a4372
15 changed files with 71 additions and 100 deletions
+3 -2
View File
@@ -8,11 +8,12 @@ interface TileChestData {
}
EverythingRegistry.register<BlockRegistry<TileChestData>>("blocks", "bworld:chest", {
id: "bworld:chest",
textures: "bworld:chest",
has_collision: false,
on_interact(world, tile) {
const [player] = world.get_tag("player")!;
on_interact(dimension, tile) {
const [player] = dimension.world.get_tag("player")!;
const player_component = player.get(PlayerComponent)!;
if (tile.data && tile.data.inventory) {
player_component.screens.push(new GuiChest(tile.data.inventory, player_component.player_inventory));