summaryrefslogtreecommitdiffstats
path: root/src/AssetManager.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-05-19 20:03:48 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-05-19 20:03:48 +0200
commit646f77ec6bc27af231b6ff8974e631b86188beb6 (patch)
treeea48447a4bdc947e67bbd900fd5716d48755619c /src/AssetManager.cpp
parentImplemented lua's "require" for AM (diff)
downloadAltCraft-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.cpp8
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 });