TESRs registering in preinit don't break pistons anymore. Fixes #2298.

This commit is contained in:
RainWarrior committed 2015-12-30 11:37:32 +03:00
1 parent 09e9a181ee
commit db3e039b31
2 files changed
+18 -2

No files matched your search

@@ -150,13 +150,13 @@ public class ModelAnimationDebug
super.preInit(event);
B3DLoader.instance.addDomain(MODID);
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(GameRegistry.findBlock(MODID, blockName)), 0, new ModelResourceLocation(MODID.toLowerCase() + ":" + blockName, "inventory"));
ClientRegistry.bindTileEntitySpecialRenderer(Chest.class, ChestRenderer.instance);
}
@Override
public void init(FMLInitializationEvent event)
{
super.init(event);
ClientRegistry.bindTileEntitySpecialRenderer(Chest.class, ChestRenderer.instance);
}
}
@@ -239,10 +239,11 @@ public class ModelAnimationDebug
public static ChestRenderer instance = new ChestRenderer();
private ChestRenderer() {}
private final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
private BlockRendererDispatcher blockRenderer;
public void renderTileEntityAt(Chest te, double x, double y, double z, float partialTick, int breakStage)
{
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
IBlockState state = te.getWorld().getBlockState(te.getPos());
state = state.withProperty(STATIC, false);
IBakedModel model = this.blockRenderer.getBlockModelShapes().getModelForState(state);