More avoidance of crashing due to separator changes.

This commit is contained in:
Ben Spiers 2014-01-05 20:20:58 +00:00
parent 8ba9aefcda
commit ab26ba5b73
2 changed files with 7 additions and 2 deletions

View file

@ -81,7 +81,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "WindTurbine.png"));
windTurbine.render(0.018F, 0);
}
else {
else if(metadata != 2) {
MekanismRenderer.renderItem(renderer, metadata, block);
}
}
@ -96,7 +96,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
{
int metadata = world.getBlockMetadata(x, y, z);
if(!GeneratorType.getFromMetadata(metadata).hasModel)
if(GeneratorType.getFromMetadata(metadata) == null || !GeneratorType.getFromMetadata(metadata).hasModel)
{
renderer.renderStandardBlock(block, x, y, z);
renderer.setRenderBoundsFromBlock(block);

View file

@ -434,6 +434,11 @@ public class BlockGenerator extends BlockContainer implements ISpecialBounds
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getBlockTileEntity(x, y, z);
ItemStack itemStack = new ItemStack(MekanismGenerators.Generator, 1, world.getBlockMetadata(x, y, z));
if(tileEntity == null)
{
return null;
}
IEnergizedItem electricItem = (IEnergizedItem)itemStack.getItem();
electricItem.setEnergy(itemStack, tileEntity.electricityStored);