mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
refactor(item): decouple items from block types
The item system now supports an ItemKind and property, allowing item JSON to declare a type instead of assuming every item is a block. BlockManager was moved to its own header, redesigned around concurrent hash maps, and exposes id_from_name(). Texture and UI code now key items by ItemID, while block placement resolves the block type from the item registry.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"id": 0,
|
||||
"name": "air",
|
||||
"description": ""
|
||||
"description": "",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 2,
|
||||
"name": "dirt",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/dirt.png"
|
||||
}
|
||||
"texture": "texture/item/block/dirt.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 9,
|
||||
"name": "grass",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/grass.png"
|
||||
}
|
||||
"texture": "texture/item/block/grass.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 1,
|
||||
"name": "grass_block",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/grass_block.png"
|
||||
"texture": "texture/item/block/grass_block.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 6,
|
||||
"name": "leaf",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/leaf.png"
|
||||
}
|
||||
"texture": "texture/item/block/leaf.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 5,
|
||||
"name": "log",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/log.png"
|
||||
}
|
||||
"texture": "texture/item/block/log.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 4,
|
||||
"name": "sand",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/sand.png"
|
||||
}
|
||||
"texture": "texture/item/block/sand.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 8,
|
||||
"name": "snowy_grass_block",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/snowy_grass_block.png"
|
||||
}
|
||||
"texture": "texture/item/block/snowy_grass_block.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 3,
|
||||
"name": "stone",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/stone.png"
|
||||
}
|
||||
"texture": "texture/item/block/stone.png",
|
||||
"type": "block"
|
||||
}
|
||||
@@ -2,5 +2,6 @@
|
||||
"id": 7,
|
||||
"name": "water",
|
||||
"description": "",
|
||||
"texture": "texture/item/block/water.png"
|
||||
}
|
||||
"texture": "texture/item/block/water.png",
|
||||
"type": "block"
|
||||
}
|
||||
Reference in New Issue
Block a user