Fix #3126 - duplicate stat id error - don't use the "universal iterators" in statbuilding, use the one without the duplicate entries. (The duplicate entry one is for rendering setup)

This commit is contained in:
cpw committed 2016-07-28 15:56:30 -04:00
1 parent 543156a008
commit bc82f2ae5a
2 files changed
+31 -4

No files matched your search

@@ -4,6 +4,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockDirt;
import net.minecraft.init.Blocks;
import net.minecraft.init.Bootstrap;
import net.minecraft.stats.StatList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.DummyModContainer;
import net.minecraftforge.fml.common.Loader;
@@ -45,6 +46,8 @@ public class SubstitutionInjectionTest
GameRegistry.addSubstitutionAlias("minecraft:dirt", GameRegistry.Type.BLOCK, toSub);
PersistentRegistryManager.freezeData();
ObjectHolderRegistry.INSTANCE.applyObjectHolders();
// This should not throw an exception
StatList.reinit();
final FMLControlledNamespacedRegistry<Block> blockRegistry = (FMLControlledNamespacedRegistry<Block>)PersistentRegistryManager.findRegistryByType(Block.class);