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
This commit is contained in:
piotrekli 2017-05-04 21:25:42 +02:00 committed by AlexIIL
parent d5033da8a1
commit 04936780cd

View file

@ -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());
}
}
}