add 'translucent' block property

This commit is contained in:
MihailRis 2024-11-13 03:40:20 +03:00
parent a7833a780d
commit b23d31a321
4 changed files with 7 additions and 1 deletions

View File

@ -6,5 +6,6 @@
"sky-light-passing": false,
"obstacle": false,
"selectable": false,
"replaceable": true
"replaceable": true,
"translucent": true
}

View File

@ -333,6 +333,7 @@ void ContentLoader::loadBlock(
root.at("inventory-size").get(def.inventorySize);
root.at("tick-interval").get(def.tickInterval);
root.at("overlay-texture").get(def.overlayTexture);
root.at("translucent").get(def.translucent);
if (root.has("fields")) {
def.dataStruct = std::make_unique<StructLayout>();

View File

@ -140,6 +140,7 @@ void Block::cloneTo(Block& dst) {
dst.inventorySize = inventorySize;
dst.tickInterval = tickInterval;
dst.overlayTexture = overlayTexture;
dst.translucent = translucent;
if (particles) {
dst.particles = std::make_unique<ParticlesPreset>(*particles);
}

View File

@ -172,6 +172,9 @@ public:
/// @brief Turns off block item generation
bool hidden = false;
/// @brief Block has semi-transparent texture
bool translucent = false;
/// @brief Set of block physical hitboxes
std::vector<AABB> hitboxes;