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

@@ -1483,10 +1483,25 @@
public static void func_149671_p()
{
func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air"));
@@ -1247,14 +2511,7 @@
@@ -1232,31 +2496,6 @@
block15.field_149783_u = flag;
}
else
{
}
-
- Set<Block> set = Sets.newHashSet(field_149771_c.func_82594_a(new ResourceLocation("tripwire")));
-
- for (Block block16 : field_149771_c)
- {
- if (set.contains(block16))
- {
- for (int i = 0; i < 15; ++i)
- {
- int j = field_149771_c.func_148757_b(block16) << 4 | i;
- field_176229_d.func_148746_a(block16.func_176203_a(i), j);
- }
- }
- else
- {
- UnmodifiableIterator unmodifiableiterator = block16.func_176194_O().func_177619_a().iterator();
-
- while (unmodifiableiterator.hasNext())
@@ -1495,7 +1510,8 @@
- int k = field_149771_c.func_148757_b(block16) << 4 | block16.func_176201_c(iblockstate);
- field_176229_d.func_148746_a(iblockstate, k);
- }
+// Handled in GameData.BlockCallbacks - leaving tripwire as it seems to be special cased
}
}
- }
- }
}
private static void func_176215_a(int p_176215_0_, ResourceLocation p_176215_1_, Block p_176215_2_)
@@ -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")