Beispiel #1
0
  private boolean linkTo(TileMarker marker, int n) {
    if (marker == null) {
      return false;
    }

    if (origin.isSet() && marker.origin.isSet()) {
      return false;
    }

    if (!origin.isSet() && !marker.origin.isSet()) {
      origin = new Origin();
      marker.origin = origin;
      origin.vectO = new TileWrapper(xCoord, yCoord, zCoord);
      origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, marker.zCoord);
    } else if (!origin.isSet()) {
      origin = marker.origin;
      origin.vect[n] = new TileWrapper(xCoord, yCoord, zCoord);
    } else {
      marker.origin = origin;
      origin.vect[n] = new TileWrapper(marker.xCoord, marker.yCoord, marker.zCoord);
    }

    origin.vectO.getMarker(worldObj).createLasers();
    updateSignals();
    marker.updateSignals();

    return true;
  }
Beispiel #2
0
  @Override
  public void initialize() {
    super.initialize();

    updateSignals();

    if (initVectO != null) {
      origin = new Origin();

      origin.vectO = new TileWrapper((int) initVectO.x, (int) initVectO.y, (int) initVectO.z);

      for (int i = 0; i < 3; ++i) {
        if (initVect[i] != null) {
          linkTo(
              (TileMarker)
                  worldObj.getTileEntity(
                      (int) initVect[i].x, (int) initVect[i].y, (int) initVect[i].z),
              i);
        }
      }
    }
  }