Beispiel #1
0
  private void readNearbyPipesSignal(WireColor color) {
    boolean foundBiggerSignal = false;

    for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
      TileEntity tile = container.getTile(o);

      if (tile instanceof TileGenericPipe) {
        TileGenericPipe tilePipe = (TileGenericPipe) tile;

        if (BlockGenericPipe.isFullyDefined(tilePipe.pipe))
          if (isWireConnectedTo(tile, color)) {
            foundBiggerSignal |=
                receiveSignal(tilePipe.pipe.signalStrength[color.ordinal()] - 1, color);
          }
      }
    }

    if (!foundBiggerSignal && signalStrength[color.ordinal()] != 0) {
      signalStrength[color.ordinal()] = 0;
      // worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
      container.scheduleRenderUpdate();

      for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
        TileEntity tile = container.getTile(o);

        if (tile instanceof TileGenericPipe) {
          TileGenericPipe tilePipe = (TileGenericPipe) tile;

          if (BlockGenericPipe.isFullyDefined(tilePipe.pipe)) {
            tilePipe.pipe.internalUpdateScheduled = true;
          }
        }
      }
    }
  }
Beispiel #2
0
  @Override
  public boolean isWireConnectedTo(TileEntity tile, WireColor color) {
    if (!(tile instanceof TileGenericPipe)) return false;

    TileGenericPipe tilePipe = (TileGenericPipe) tile;

    if (!BlockGenericPipe.isFullyDefined(tilePipe.pipe)) return false;

    if (!tilePipe.pipe.wireSet[color.ordinal()]) return false;

    return (tilePipe.pipe.transport instanceof PipeTransportStructure
        || transport instanceof PipeTransportStructure
        || Utils.checkPipesConnections(container, tile));
  }
Beispiel #3
0
 @Override
 public boolean isWired(WireColor color) {
   return wireSet[color.ordinal()];
 }
Beispiel #4
0
  // / @Override TODO: should be in IPipe
  public boolean isWired() {
    for (WireColor color : WireColor.values()) if (isWired(color)) return true;

    return false;
  }