From f6a378e136e6ef4d2a660f8bb08a269ce56d5810 Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Wed, 14 Jan 2015 19:02:50 -0800 Subject: [PATCH] Silently eat exceptions when getting a TE's rendering bounding box, this 'fixes' Bukkit servers screwing up world data and causing clients to crash. --- .../minecraft/tileentity/TileEntity.java.patch | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch index 17834bcad..5c5ef4768 100644 --- a/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch +++ b/patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java -@@ -294,4 +294,92 @@ +@@ -294,4 +294,106 @@ func_145826_a(TileEntityFlowerPot.class, "FlowerPot"); func_145826_a(TileEntityBanner.class, "Banner"); } @@ -73,7 +73,21 @@ + } + else if (type != null && type != Blocks.field_150461_bJ) + { -+ net.minecraft.util.AxisAlignedBB cbb = type.func_180640_a(field_145850_b, func_174877_v(), field_145850_b.func_180495_p(func_174877_v())); ++ net.minecraft.util.AxisAlignedBB cbb = null; ++ try ++ { ++ cbb = type.func_180640_a(field_145850_b, func_174877_v(), field_145850_b.func_180495_p(func_174877_v())); ++ } ++ catch (Exception e) ++ { ++ // We have to capture any exceptions that may occur here because BUKKIT servers like to send ++ // the tile entity data BEFORE the chunk data, you know, the OPPOSITE of what vanilla does! ++ // So we can not GARENTEE that the world state is the real state for the block... ++ // So, once again in the long line of US having to accommodate BUKKIT breaking things, ++ // here it is, assume that the TE is only 1 cubic block. Problem with this is that it may ++ // cause the TileEntity renderer to error further down the line! But alas, nothing we can do. ++ cbb = new net.minecraft.util.AxisAlignedBB(func_174877_v().func_177982_a(-1, 0, -1), func_174877_v().func_177982_a(1, 1, 1)); ++ } + if (cbb != null) bb = cbb; + } + return bb;