From 6d6405973ce067c4e00b1fbe63dd1fd1615b36ba Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 28 Jan 2013 18:05:38 -0800 Subject: [PATCH] Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 --- .../TileEntityChestRenderer.java.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch diff --git a/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch new file mode 100644 index 000000000..46392dd59 --- /dev/null +++ b/patches/minecraft/net/minecraft/client/renderer/tileentity/TileEntityChestRenderer.java.patch @@ -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(); + } +