From 04936780cd04f3c90d7c56349c4b9ed096f0a901 Mon Sep 17 00:00:00 2001 From: piotrekli Date: Thu, 4 May 2017 21:25:42 +0200 Subject: [PATCH] Fix a crash when a machine "clicks" on a gate (#3542) Fix a crash when a Thermal Expansion Autonomous Activator clicks on a BuildCraft gate --- common/buildcraft/transport/Gate.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/transport/Gate.java b/common/buildcraft/transport/Gate.java index 1655c60b..b7f6084a 100644 --- a/common/buildcraft/transport/Gate.java +++ b/common/buildcraft/transport/Gate.java @@ -325,7 +325,10 @@ public final class Gate implements IGate, ISidedStatementContainer, IRedstoneSta public void openGui(EntityPlayer player) { if (!player.worldObj.isRemote) { player.openGui(BuildCraftTransport.instance, GuiIds.GATES, pipe.container.getWorldObj(), pipe.container.xCoord, pipe.container.yCoord, pipe.container.zCoord); - ((ContainerGateInterface) player.openContainer).setGate(direction.ordinal()); + // ThermalExpansion Autonomous Activator crash fix + if (player.openContainer instanceof ContainerGateInterface) { + ((ContainerGateInterface) player.openContainer).setGate(direction.ordinal()); + } } }