redstone output is now sided for gates, close #2085

This commit is contained in:
asiekierka 2014-10-24 16:22:32 +02:00
parent 482e1d575c
commit 030191d7cd

View file

@ -407,18 +407,10 @@ public abstract class Pipe<T extends PipeTransport> implements IDropControlInven
return false;
}
private int getMaxRedstoneOutput() {
int max = 0;
private int getRedstoneOutput(ForgeDirection dir) {
Gate gate = gates[dir.ordinal()];
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Gate gate = gates[dir.ordinal()];
if (gate != null && gate.getRedstoneOutput() > max) {
max = gate.getRedstoneOutput();
}
}
return max;
return gate != null ? gate.getRedstoneOutput() : 0;
}
public int isPoweringTo(int side) {
@ -429,7 +421,7 @@ public abstract class Pipe<T extends PipeTransport> implements IDropControlInven
if (tile instanceof TileGenericPipe && container.isPipeConnected(o)) {
return 0;
} else {
return getMaxRedstoneOutput();
return getRedstoneOutput(o);
}
}