mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
add explicit 'solid' block property
This commit is contained in:
parent
336ae09f66
commit
e451a4f3a3
5 changed files with 12 additions and 4 deletions
|
|
@ -34,11 +34,15 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
|
||||
if (def.variants) {
|
||||
for (auto& variant : def.variants->variants) {
|
||||
variant.rt.solid = variant.model.type == BlockModelType::BLOCK;
|
||||
variant.rt.solid =
|
||||
variant.model.type == BlockModelType::BLOCK ||
|
||||
def.explictlySolid;
|
||||
}
|
||||
def.defaults = def.variants->variants.at(0);
|
||||
} else {
|
||||
def.defaults.rt.solid = def.defaults.model.type == BlockModelType::BLOCK;
|
||||
def.defaults.rt.solid =
|
||||
def.defaults.model.type == BlockModelType::BLOCK ||
|
||||
def.explictlySolid;
|
||||
}
|
||||
|
||||
const float EPSILON = 0.01f;
|
||||
|
|
|
|||
|
|
@ -227,6 +227,7 @@ template<> void ContentUnitLoader<Block>::loadUnit(
|
|||
root.at("tick-interval").get(def.tickInterval);
|
||||
root.at("overlay-texture").get(def.overlayTexture);
|
||||
root.at("translucent").get(def.translucent);
|
||||
root.at("solid").get(def.explictlySolid);
|
||||
|
||||
if (root.has("fields")) {
|
||||
def.dataStruct = std::make_unique<StructLayout>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue