From 3d0d2b2fe2870b6fb612c3d3b8c937ebbfdfd585 Mon Sep 17 00:00:00 2001 From: warlordjones Date: Sun, 22 Feb 2015 01:50:45 +0000 Subject: [PATCH] Prevent RC Invisiblock related crashes (Closes #238) --- .../com/cricketcraft/chisel/block/BlockPresent.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java b/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java index feff0d69..b362f260 100644 --- a/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java +++ b/src/main/java/com/cricketcraft/chisel/block/BlockPresent.java @@ -31,7 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockPresent extends Block implements ICarvable { public CarvableHelper carverHelper; - + private float minX, minY, minZ, maxX, maxY, maxZ; public BlockPresent() { @@ -48,7 +48,7 @@ public class BlockPresent extends Block implements ICarvable { public String getModelTexture(int type) { return "textures/blocks/present/presentChest" + type; } - + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void getSubBlocks(Item item, CreativeTabs tab, List list) { @@ -118,12 +118,16 @@ public class BlockPresent extends Block implements ICarvable { @Override public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { + if(world.getTileEntity(x, y, z) instanceof TileEntityPresent) return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); + else return null; } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { + if(world.getTileEntity(x, y, z) instanceof TileEntityPresent) return getBoundingBox((TileEntityPresent) world.getTileEntity(x, y, z)); + else return null; } public AxisAlignedBB getBoundingBox(TileEntityPresent me) { @@ -169,7 +173,7 @@ public class BlockPresent extends Block implements ICarvable { } } } - + @Override public boolean hasTileEntity(int metadata) { return true; @@ -193,7 +197,7 @@ public class BlockPresent extends Block implements ICarvable { } return 0; } - + @Override public int damageDropped(int meta) { return meta;