From fa98a71d1834f1c8b27a95127aa33456e504cea3 Mon Sep 17 00:00:00 2001 From: SpaceToad Date: Mon, 16 Jun 2014 08:52:23 +0200 Subject: [PATCH] Redstone output is send to all sides again, following up on #1886. --- common/buildcraft/transport/Pipe.java | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/common/buildcraft/transport/Pipe.java b/common/buildcraft/transport/Pipe.java index 9fb9da8a..74c96d06 100644 --- a/common/buildcraft/transport/Pipe.java +++ b/common/buildcraft/transport/Pipe.java @@ -400,19 +400,30 @@ public abstract class Pipe implements IDropControlInven return false; } + private int getMaxRedstoneOutput() { + int max = 0; + + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + Gate gate = gates[dir.ordinal()]; + + if (gate != null && gate.getRedstoneOutput() > max) { + max = gate.getRedstoneOutput(); + } + } + + return max; + } + public int isPoweringTo(int side) { ForgeDirection o = ForgeDirection.getOrientation(side).getOpposite(); - Gate gate = gates[o.ordinal()]; - if (gate != null && gate.getRedstoneOutput() > 0) { - TileEntity tile = container.getTile(o); - if (tile instanceof TileGenericPipe && container.isPipeConnected(o)) { - return 0; - } + TileEntity tile = container.getTile(o); - return gate.getRedstoneOutput(); + if (tile instanceof TileGenericPipe && container.isPipeConnected(o)) { + return 0; + } else { + return getMaxRedstoneOutput(); } - return 0; } public int isIndirectlyPoweringTo(int l) {