Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389

This commit is contained in:
LexManos 2013-01-28 18:05:38 -08:00
parent 704f879320
commit 6d6405973c

View file

@ -0,0 +1,26 @@
--- ../src_base/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java
@@ -1,5 +1,6 @@
package net.minecraft.client.renderer.tileentity;
+import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Calendar;
@@ -50,7 +51,15 @@
if (var10 != null && var9 == 0)
{
- ((BlockChest)var10).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
+ try
+ {
+ ((BlockChest)var10).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
+ }
+ catch (ClassCastException e)
+ {
+ FMLLog.severe("Attempted to render a chest at %d, %d, %d that was not a chest",
+ par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord);
+ }
var9 = par1TileEntityChest.getBlockMetadata();
}