mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add item 'uses-display' property
This commit is contained in:
parent
449b0ebca4
commit
df2cff3e4c
4 changed files with 56 additions and 13 deletions
|
|
@ -438,6 +438,18 @@ void ContentLoader::loadItem(
|
|||
root.at("stack-size").get(def.stackSize);
|
||||
root.at("uses").get(def.uses);
|
||||
|
||||
std::string usesDisplayStr = "";
|
||||
root.at("uses-display").get(usesDisplayStr);
|
||||
if (usesDisplayStr == "none") {
|
||||
def.usesDisplay = ItemUsesDisplay::NONE;
|
||||
} else if (usesDisplayStr == "relation") {
|
||||
def.usesDisplay = ItemUsesDisplay::RELATION;
|
||||
} else if (usesDisplayStr == "vbar") {
|
||||
def.usesDisplay = ItemUsesDisplay::VBAR;
|
||||
} else if (usesDisplayStr.length()) {
|
||||
logger.error() << name << ": unknown uses display mode " << usesDisplayStr;
|
||||
}
|
||||
|
||||
if (auto found = root.at("emission")) {
|
||||
const auto& emissionarr = *found;
|
||||
def.emission[0] = emissionarr[0].asNumber();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue