bugfix sensitive cable

This commit is contained in:
Raoul Van den Berge
2015-12-19 14:05:57 +01:00
parent 54e4885020
commit 6b1a3283ff
2 changed files with 14 additions and 2 deletions

View File

@@ -33,6 +33,14 @@ public class TileCable extends TileBase {
return worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1;
}
public boolean isActive() {
if (isSensitiveCable()) {
return !isPowered();
}
return true;
}
public void addMachines(List<Vec3> visited, List<TileMachine> machines, TileController controller) {
for (Vec3 visitedBlock : visited) {
if (visitedBlock.xCoord == xCoord && visitedBlock.yCoord == yCoord && visitedBlock.zCoord == zCoord) {
@@ -68,7 +76,7 @@ public class TileCable extends TileBase {
} else if (tile instanceof TileCable) {
TileCable cable = (TileCable) tile;
if (!cable.isSensitiveCable() || (cable.isSensitiveCable() && !cable.isPowered())) {
if (cable.isActive()) {
((TileCable) tile).addMachines(visited, machines, controller);
}
} else if (tile instanceof TileController && (x != controller.xCoord || y != controller.yCoord || z != controller.zCoord)) {