bugfix sensitive cable
This commit is contained in:
@@ -33,6 +33,14 @@ public class TileCable extends TileBase {
|
|||||||
return worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1;
|
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) {
|
public void addMachines(List<Vec3> visited, List<TileMachine> machines, TileController controller) {
|
||||||
for (Vec3 visitedBlock : visited) {
|
for (Vec3 visitedBlock : visited) {
|
||||||
if (visitedBlock.xCoord == xCoord && visitedBlock.yCoord == yCoord && visitedBlock.zCoord == zCoord) {
|
if (visitedBlock.xCoord == xCoord && visitedBlock.yCoord == yCoord && visitedBlock.zCoord == zCoord) {
|
||||||
@@ -68,7 +76,7 @@ public class TileCable extends TileBase {
|
|||||||
} else if (tile instanceof TileCable) {
|
} else if (tile instanceof TileCable) {
|
||||||
TileCable cable = (TileCable) tile;
|
TileCable cable = (TileCable) tile;
|
||||||
|
|
||||||
if (!cable.isSensitiveCable() || (cable.isSensitiveCable() && !cable.isPowered())) {
|
if (cable.isActive()) {
|
||||||
((TileCable) tile).addMachines(visited, machines, controller);
|
((TileCable) tile).addMachines(visited, machines, controller);
|
||||||
}
|
}
|
||||||
} else if (tile instanceof TileController && (x != controller.xCoord || y != controller.yCoord || z != controller.zCoord)) {
|
} else if (tile instanceof TileController && (x != controller.xCoord || y != controller.yCoord || z != controller.zCoord)) {
|
||||||
|
@@ -51,7 +51,11 @@ public class TileController extends TileBase implements IEnergyReceiver, INetwor
|
|||||||
TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||||
|
|
||||||
if (tile instanceof TileCable) {
|
if (tile instanceof TileCable) {
|
||||||
((TileCable) tile).addMachines(visitedCables, newMachines, this);
|
TileCable cable = (TileCable) tile;
|
||||||
|
|
||||||
|
if (cable.isActive()) {
|
||||||
|
cable.addMachines(visitedCables, newMachines, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user