From a145405376c6f92276d49cd0a830fe7af47d691e Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Tue, 2 Jun 2015 00:49:46 -0400 Subject: [PATCH] Fix rare class cast exception with conduit sound handling --- .../crazypants/enderio/conduit/BlockConduitBundle.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java b/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java index 1646ba46..9f570189 100644 --- a/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java +++ b/src/main/java/crazypants/enderio/conduit/BlockConduitBundle.java @@ -207,8 +207,8 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade ISound snd = event.sound; World world = EnderIO.proxy.getClientWorld(); BlockCoord bc = new BlockCoord(snd.getXPosF(), snd.getYPosF(), snd.getZPosF()); - TileConduitBundle te = (TileConduitBundle) bc.getTileEntity(world); - if (te != null && te.hasFacade()) { + TileEntity te = bc.getTileEntity(world); + if (te != null && te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) { Block facade = getFacade(world, bc.x, bc.y, bc.z, -1); ConduitUtil.playHitSound(facade.stepSound, world, bc.x, bc.y, bc.z); } else { @@ -224,8 +224,8 @@ public class BlockConduitBundle extends BlockEio implements IGuiHandler, IFacade World world = event.entity.worldObj; if ("EnderIO:silence.step".equals(path) && world.isRemote) { BlockCoord bc = new BlockCoord(event.entity.posX, event.entity.posY - 2, event.entity.posZ); - TileConduitBundle te = (TileConduitBundle) bc.getTileEntity(world); - if (te != null && te.hasFacade()) { + TileEntity te = bc.getTileEntity(world); + if (te != null && te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) { Block facade = getFacade(world, bc.x, bc.y, bc.z, -1); ConduitUtil.playStepSound(facade.stepSound, world, bc.x, bc.y, bc.z); } else {