add BlockModel struct

This commit is contained in:
MihailRis
2025-04-27 18:21:56 +03:00
parent 718f5d1089
commit 20e3a961f9
12 changed files with 46 additions and 39 deletions
-1
View File
@@ -143,7 +143,6 @@ void Block::cloneTo(Block& dst) {
if (particles) {
dst.particles = std::make_unique<ParticlesPreset>(*particles);
}
dst.customModelRaw = customModelRaw;
}
static std::set<std::string, std::less<>> RESERVED_BLOCK_FIELDS {
+12 -7
View File
@@ -94,6 +94,16 @@ enum class BlockModelType {
CUSTOM
};
struct BlockModel {
BlockModelType type = BlockModelType::BLOCK;
/// @brief Custom model raw data
dv::value customRaw = nullptr;
/// @brief Custom model name (generated or an asset)
std::string name = "";
};
VC_ENUM_METADATA(BlockModelType)
{"none", BlockModelType::NONE},
{"block", BlockModelType::BLOCK},
@@ -152,13 +162,8 @@ public:
/// @brief Influences visible block sides for transparent blocks
uint8_t drawGroup = 0;
/// @brief Block model type
BlockModelType model = BlockModelType::BLOCK;
/// @brief Custom model raw data
dv::value customModelRaw = nullptr;
std::string modelName = "";
/// @brief Block model
BlockModel model {};
/// @brief Culling mode
CullingMode culling = CullingMode::DEFAULT;