mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 18:09:46 +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
|
||||
.require(
|
||||
def->pickingItem.empty()
|
||||
? (def->hidden ? CORE_EMPTY
|
||||
? ((def->abstract || def->hidden) ? CORE_EMPTY
|
||||
: def->name + BLOCK_ITEM_SUFFIX)
|
||||
: def->pickingItem
|
||||
)
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ void ContentLoader::loadContent(const dv::value& root) {
|
|||
|
||||
ContentUnitLoader<Block>(*pack, builder.blocks, "blocks",
|
||||
[this](const Block& def) {
|
||||
if (!def.hidden) {
|
||||
if (!def.abstract || !def.hidden) {
|
||||
bool created;
|
||||
auto& item = builder.items.create(
|
||||
def.name + BLOCK_ITEM_SUFFIX, &created
|
||||
|
|
|
|||
|
|
@ -260,6 +260,7 @@ template<> void ContentUnitLoader<Block>::loadUnit(
|
|||
root.at("selectable").get(def.selectable);
|
||||
root.at("grounded").get(def.grounded);
|
||||
root.at("hidden").get(def.hidden);
|
||||
root.at("abstract").get(def.abstract);
|
||||
root.at("picking-item").get(def.pickingItem);
|
||||
root.at("surface-replacement").get(def.surfaceReplacement);
|
||||
root.at("script-name").get(def.scriptName);
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ public:
|
|||
/// below
|
||||
bool grounded = false;
|
||||
|
||||
/// @brief Makes block abstract
|
||||
bool abstract = false;
|
||||
|
||||
/// @brief Turns off block item generation
|
||||
bool hidden = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue