mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
cache block.index, block.name, item.index, item.name
This commit is contained in:
parent
913f942adb
commit
086c20c370
2 changed files with 30 additions and 1 deletions
|
|
@ -91,10 +91,18 @@ std::unique_ptr<Content> ContentBuilder::build() {
|
|||
for (Block* def : blockDefsIndices) {
|
||||
def->rt.pickingItem = content->items.require(def->pickingItem).rt.id;
|
||||
def->rt.surfaceReplacement = content->blocks.require(def->surfaceReplacement).rt.id;
|
||||
if (def->properties == nullptr) {
|
||||
def->properties = dv::object();
|
||||
}
|
||||
def->properties["name"] = def->name;
|
||||
}
|
||||
|
||||
for (ItemDef* def : itemDefsIndices) {
|
||||
def->rt.placingBlock = content->blocks.require(def->placingBlock).rt.id;
|
||||
if (def->properties == nullptr) {
|
||||
def->properties = dv::object();
|
||||
}
|
||||
def->properties["name"] = def->name;
|
||||
}
|
||||
|
||||
for (auto& [name, def] : content->generators.getDefs()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue