Files
MinecraftForge/patches/common/net/minecraft/src/TileEntity.java.patch
T

47 lines
1.3 KiB
Diff

--- ../src-base/common/net/minecraft/src/TileEntity.java
+++ ../src-work/common/net/minecraft/src/TileEntity.java
@@ -1,9 +1,11 @@
package net.minecraft.src;
+import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import java.util.HashMap;
import java.util.Map;
+import java.util.logging.Level;
public class TileEntity
{
@@ -75,10 +77,10 @@
public static TileEntity func_70317_c(NBTTagCompound p_70317_0_)
{
TileEntity var1 = null;
-
+ Class var2 = null;
try
{
- Class var2 = (Class)field_70326_a.get(p_70317_0_.func_74779_i("id"));
+ var2 = (Class)field_70326_a.get(p_70317_0_.func_74779_i("id"));
if (var2 != null)
{
@@ -92,7 +94,17 @@
if (var1 != null)
{
- var1.func_70307_a(p_70317_0_);
+ try
+ {
+ var1.func_70307_a(p_70317_0_);
+ }
+ catch (Exception e)
+ {
+ FMLLog.log(Level.SEVERE, e,
+ "A TileEntity %s(%s) has thrown an exception during loading, its state cannot be restored. Report this to the mod author",
+ p_70317_0_.func_74779_i("id"), var2.getName());
+ var1 = null;
+ }
}
else
{