add GeneratorDef

This commit is contained in:
MihailRis
2024-08-14 01:23:14 +03:00
parent cae314bc36
commit 5fa6b14f05
6 changed files with 22 additions and 9 deletions
+5 -8
View File
@@ -19,6 +19,7 @@ class Block;
struct BlockMaterial;
struct ItemDef;
struct EntityDef;
struct GeneratorDef;
namespace rigging {
class SkeletonConfig;
@@ -34,6 +35,8 @@ constexpr const char* ContentType_name(ContentType type) {
return "item";
case ContentType::ENTITY:
return "entity";
case ContentType::GENERATOR:
return "generator";
default:
return "unknown";
}
@@ -65,14 +68,6 @@ public:
return defs[id];
}
[[deprecated]]
inline T* getWriteable(blockid_t id) const { // TODO: remove
if (id >= defs.size()) {
return nullptr;
}
return defs[id];
}
inline const T& require(blockid_t id) const {
return *defs.at(id);
}
@@ -197,6 +192,7 @@ public:
ContentUnitDefs<Block> blocks;
ContentUnitDefs<ItemDef> items;
ContentUnitDefs<EntityDef> entities;
ContentUnitDefs<GeneratorDef> generators;
std::unique_ptr<DrawGroups> const drawGroups;
ResourceIndicesSet resourceIndices {};
@@ -206,6 +202,7 @@ public:
ContentUnitDefs<Block> blocks,
ContentUnitDefs<ItemDef> items,
ContentUnitDefs<EntityDef> entities,
ContentUnitDefs<GeneratorDef> generators,
UptrsMap<std::string, ContentPackRuntime> packs,
UptrsMap<std::string, BlockMaterial> blockMaterials,
UptrsMap<std::string, rigging::SkeletonConfig> skeletons,