Ejemplo n.º 1
0
  public void initialize(Pipe pipe) {

    this.pipe = pipe;

    tileBuffer = new TileBuffer[6];

    for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
      Position pos = new Position(xCoord, yCoord, zCoord, o);
      pos.moveForwards(1.0);

      tileBuffer[o.ordinal()] = new TileBuffer();
      tileBuffer[o.ordinal()].initialize(worldObj, (int) pos.x, (int) pos.y, (int) pos.z);
    }

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

      if (tile instanceof ITileBufferHolder)
        ((ITileBufferHolder) tile)
            .blockCreated(o, BuildCraftTransport.genericPipeBlock.blockID, this);
    }

    bindPipe();

    computeConnections();
    scheduleRenderUpdate();

    if (pipe != null) pipe.initialize();

    initialized = true;
  }
Ejemplo n.º 2
0
 @Override
 public void validate() {
   super.validate();
   bindPipe();
   if (pipe != null) {
     pipe.validate();
   }
 }
Ejemplo n.º 3
0
  @Override
  public Packet getDescriptionPacket() {
    bindPipe();

    PacketTileState packet = new PacketTileState(this.xCoord, this.yCoord, this.zCoord);
    if (pipe != null && pipe.gate != null) {
      coreState.gateKind = pipe.gate.kind.ordinal();
    } else {
      coreState.gateKind = 0;
    }
    packet.addStateForSerialization((byte) 0, coreState);
    packet.addStateForSerialization((byte) 1, renderState);
    if (pipe instanceof IClientState) {
      packet.addStateForSerialization((byte) 2, (IClientState) pipe);
    }
    return packet.getPacket();
  }
Ejemplo n.º 4
0
 public Packet getDescriptionPacket() {
   bindPipe();
   PipeRenderStatePacket packet =
       new PipeRenderStatePacket(this.renderState, this.pipeId, xCoord, yCoord, zCoord);
   return packet.getPacket();
 }