Vanilla/mod bug fixes: CME on entity processing, TileEntity resetting chunk on save/load.

This commit is contained in:
Christian committed 2012-10-29 17:41:08 -04:00
1 parent b23081df78
commit a7eb5dc773
6 files changed
+140 -8

No files matched your search

@@ -0,0 +1,44 @@
--- ../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,15 @@
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
{