fix block model is not loading automatically

This commit is contained in:
MihailRis 2024-11-07 07:30:47 +03:00
parent 86b5f5d82b
commit 04c25ef214
2 changed files with 9 additions and 2 deletions

View File

@ -235,6 +235,15 @@ void AssetsLoader::addDefaults(AssetsLoader& loader, const Content* content) {
}
}
}
for (const auto& [_, def] : content->blocks.getDefs()) {
if (def->modelName.find(':') == std::string::npos) {
loader.add(
AssetType::MODEL,
MODELS_FOLDER + "/" + def->modelName,
def->modelName
);
}
}
for (const auto& [_, def] : content->items.getDefs()) {
if (def->modelName.find(':') == std::string::npos) {
loader.add(

View File

@ -11,8 +11,6 @@
#include "maths/UVRegion.hpp"
#include "voxels/Block.hpp"
#include <iostream>
ContentGfxCache::ContentGfxCache(const Content* content, Assets* assets)
: content(content) {
auto indices = content->getIndices();