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:
cpw committed 2016-07-26 17:16:42 -04:00
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
}
}