diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-05-19 20:03:48 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-05-19 20:03:48 +0200 |
commit | 646f77ec6bc27af231b6ff8974e631b86188beb6 (patch) | |
tree | ea48447a4bdc947e67bbd900fd5716d48755619c /src/AssetManager.cpp | |
parent | Implemented lua's "require" for AM (diff) | |
download | AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.gz AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.bz2 AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.lz AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.xz AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.tar.zst AltCraft-646f77ec6bc27af231b6ff8974e631b86188beb6.zip |
Diffstat (limited to 'src/AssetManager.cpp')
-rw-r--r-- | src/AssetManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index be69dd0..19cd452 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -613,16 +613,16 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) { return blockIdToBlockFaces.find(block)->second; } - auto blockStateName = TransformBlockIdToBlockStateName(block); - AssetBlockState *asset = GetAsset<AssetBlockState>("/minecraft/blockstates/" + blockStateName.first); + BlockInfo blockInfo = GetBlockInfo(block); + AssetBlockState *asset = GetAsset<AssetBlockState>("/minecraft/blockstates/" + blockInfo.blockstate); if (!asset) return GetBlockModelByBlockId(BlockId{ 7788,0 }); BlockState &blockState = asset->blockState; - if (blockState.variants.find(blockStateName.second) == blockState.variants.end()) + if (blockState.variants.find(blockInfo.variant) == blockState.variants.end()) return GetBlockModelByBlockId(BlockId{ 7788,0 }); - BlockStateVariant &variant = blockState.variants[blockStateName.second]; + BlockStateVariant &variant = blockState.variants[blockInfo.variant]; if (variant.models.empty()) return GetBlockModelByBlockId(BlockId{ 7788,0 }); |