mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-23 10:59:45 +00:00
add 'abstract' block property
This commit is contained in:
parent
f0a407c20a
commit
33180fc648
4 changed files with 6 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
||||||
content->items
|
content->items
|
||||||
.require(
|
.require(
|
||||||
def->pickingItem.empty()
|
def->pickingItem.empty()
|
||||||
? (def->hidden ? CORE_EMPTY
|
? ((def->abstract || def->hidden) ? CORE_EMPTY
|
||||||
: def->name + BLOCK_ITEM_SUFFIX)
|
: def->name + BLOCK_ITEM_SUFFIX)
|
||||||
: def->pickingItem
|
: def->pickingItem
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ void ContentLoader::loadContent(const dv::value& root) {
|
||||||
|
|
||||||
ContentUnitLoader<Block>(*pack, builder.blocks, "blocks",
|
ContentUnitLoader<Block>(*pack, builder.blocks, "blocks",
|
||||||
[this](const Block& def) {
|
[this](const Block& def) {
|
||||||
if (!def.hidden) {
|
if (!def.abstract || !def.hidden) {
|
||||||
bool created;
|
bool created;
|
||||||
auto& item = builder.items.create(
|
auto& item = builder.items.create(
|
||||||
def.name + BLOCK_ITEM_SUFFIX, &created
|
def.name + BLOCK_ITEM_SUFFIX, &created
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ template<> void ContentUnitLoader<Block>::loadUnit(
|
||||||
root.at("selectable").get(def.selectable);
|
root.at("selectable").get(def.selectable);
|
||||||
root.at("grounded").get(def.grounded);
|
root.at("grounded").get(def.grounded);
|
||||||
root.at("hidden").get(def.hidden);
|
root.at("hidden").get(def.hidden);
|
||||||
|
root.at("abstract").get(def.abstract);
|
||||||
root.at("picking-item").get(def.pickingItem);
|
root.at("picking-item").get(def.pickingItem);
|
||||||
root.at("surface-replacement").get(def.surfaceReplacement);
|
root.at("surface-replacement").get(def.surfaceReplacement);
|
||||||
root.at("script-name").get(def.scriptName);
|
root.at("script-name").get(def.scriptName);
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,9 @@ public:
|
||||||
/// below
|
/// below
|
||||||
bool grounded = false;
|
bool grounded = false;
|
||||||
|
|
||||||
|
/// @brief Makes block abstract
|
||||||
|
bool abstract = false;
|
||||||
|
|
||||||
/// @brief Turns off block item generation
|
/// @brief Turns off block item generation
|
||||||
bool hidden = false;
|
bool hidden = false;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue