Fix tripwire statemap not being complete when mappings change. Closes #3924

This commit is contained in:
LexManos committed 2017-07-18 12:53:55 -07:00
1 parent 6d35b1b913
commit afea45dccc
2 files changed
+28 -7

No files matched your search

@@ -285,6 +285,12 @@ public class GameData
@SuppressWarnings("unchecked")
ClearableObjectIntIdentityMap<IBlockState> blockstateMap = owner.getSlaveMap(BLOCKSTATE_TO_ID, ClearableObjectIntIdentityMap.class);
if ("minecraft:tripwire".equals(block.getRegistryName().toString())) //Tripwire is crap so we have to special case whee!
{
for (int meta = 0; meta < 15; meta++)
blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta);
}
//So, due to blocks having more in-world states then metadata allows, we have to turn the map into a semi-milti-bimap.
//We can do this however because the implementation of the map is last set wins. So we can add all states, then fix the meta bimap.
//Multiple states -> meta. But meta to CORRECT state.
@@ -303,7 +309,6 @@ public class GameData
blockstateMap.put(block.getStateFromMeta(meta), id << 4 | meta); // Put the CORRECT thing!
}
if (oldBlock != null)
{
@SuppressWarnings("unchecked")