From 960e98dc3dbda0666e2c412560996fab7628a824 Mon Sep 17 00:00:00 2001 From: Prototik Date: Mon, 5 May 2014 20:29:28 +0800 Subject: [PATCH] Make block gate triggers by plugs --- common/buildcraft/transport/Gate.java | 2 +- .../transport/gui/ContainerGateInterface.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/common/buildcraft/transport/Gate.java b/common/buildcraft/transport/Gate.java index 01837b0c..29e07dbe 100644 --- a/common/buildcraft/transport/Gate.java +++ b/common/buildcraft/transport/Gate.java @@ -322,7 +322,7 @@ public final class Gate { if (trigger instanceof ITileTrigger) { for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { TileEntity tile = pipe.container.getTile(o); - if (tile != null && !(tile instanceof TileGenericPipe)) { + if (tile != null && !(tile instanceof TileGenericPipe) && pipe.hasGate(o)) { if (((ITileTrigger) trigger).isTriggerActive(o.getOpposite(), tile, parameter)) { return true; } diff --git a/common/buildcraft/transport/gui/ContainerGateInterface.java b/common/buildcraft/transport/gui/ContainerGateInterface.java index 638deaf7..e2e76029 100644 --- a/common/buildcraft/transport/gui/ContainerGateInterface.java +++ b/common/buildcraft/transport/gui/ContainerGateInterface.java @@ -95,10 +95,12 @@ public class ContainerGateInterface extends BuildCraftContainer { } for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { - TileEntity tile = pipe.container.getTile(o); - Block block = pipe.container.getBlock(o); - potentialTriggers.addAll(ActionManager.getNeighborTriggers(block, tile)); - potentialActions.addAll(ActionManager.getNeighborActions(block, tile)); + if (pipe.hasGate(o)) { + TileEntity tile = pipe.container.getTile(o); + Block block = pipe.container.getBlock(o); + potentialTriggers.addAll(ActionManager.getNeighborTriggers(block, tile)); + potentialActions.addAll(ActionManager.getNeighborActions(block, tile)); + } } if (!pipe.gate.material.hasParameterSlot) {