mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix a vanilla bug with the blockstate ID map not being properly symmetric with respect to block.getStateFromMeta - closes #3012 properly but probably has a random MCJIRA ticket somewhere too.
This commit is contained in:
1 parent
5a3047fbc2
commit
ab64d1a166
3 files changed
+78
-1
No files matched your search
@@ -288,7 +288,10 @@ public class GameData
|
||||
ClearableObjectIntIdentityMap<IBlockState> blockstateMap = (ClearableObjectIntIdentityMap<IBlockState>)slaves.get(BLOCKSTATE_TO_ID);
|
||||
for (IBlockState state : block.getBlockState().getValidStates())
|
||||
{
|
||||
blockstateMap.put(state, blockId << 4 | block.getMetaFromState(state));
|
||||
final int meta = block.getMetaFromState(state); // meta value the block assigns for the state
|
||||
final int bsmeta = blockId << 4 | meta; // computed blockstateid for that meta
|
||||
final IBlockState blockState = block.getStateFromMeta(meta); // state that the block assigns for the meta value
|
||||
blockstateMap.put(blockState, bsmeta); // store assigned state with computed blockstateid
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user