remove sensitive cable

This commit is contained in:
Raoul Van den Berge
2016-01-02 17:41:52 +01:00
parent 811035d17a
commit 7b38bce072
12 changed files with 71 additions and 172 deletions

View File

@@ -18,39 +18,24 @@ public class TileCable extends TileBase
public boolean hasConnection(EnumFacing dir)
{
if (!isCable(worldObj, pos.offset(dir)))
if (!isEnabled())
{
TileEntity tile = worldObj.getTileEntity(pos.offset(dir));
return tile instanceof TileMachine || tile instanceof TileController;
return false;
}
return true;
}
public boolean isPowered()
{
return worldObj.isBlockPowered(pos);
}
public boolean isSensitiveCable()
{
if (worldObj.getBlockState(pos).getBlock() == StorageCraftBlocks.CABLE)
if (isCable(worldObj, pos.offset(dir)))
{
return (Boolean) worldObj.getBlockState(pos).getValue(BlockCable.SENSITIVE);
return true;
}
return false;
TileEntity tile = worldObj.getTileEntity(pos.offset(dir));
return tile instanceof TileMachine || tile instanceof TileController;
}
public boolean isEnabled()
{
if (isSensitiveCable())
{
return !isPowered();
}
return true;
return !worldObj.isBlockPowered(pos);
}
public void addMachines(List<BlockPos> visited, List<TileMachine> machines, TileController controller)