Package buildcraft.api.core

Examples of buildcraft.api.core.BlockIndex


    iterateBpt(false);
  }

  public void createLasersForPath() {
    pathLasers = new LinkedList<LaserData>();
    BlockIndex previous = null;

    for (BlockIndex b : path) {
      if (previous != null) {
        LaserData laser = new LaserData(new Position(previous.x + 0.5,
            previous.y + 0.5, previous.z + 0.5), new Position(
View Full Code Here


    if (currentBuilder == null || (currentBuilder.isDone(this) || forceIterate)) {
      if (path != null && path.size() > 1) {
        if (currentPathIterator == null) {
          Iterator<BlockIndex> it = path.iterator();
          BlockIndex start = it.next();
          currentPathIterator = new PathIterator(start, it,
              ForgeDirection.values()[worldObj.getBlockMetadata(
                  xCoord, yCoord, zCoord)].getOpposite());
        }
View Full Code Here

      path = new LinkedList<BlockIndex>();
      NBTTagList list = nbttagcompound.getTagList("path",
          Constants.NBT.TAG_COMPOUND);

      for (int i = 0; i < list.tagCount(); ++i) {
        path.add(new BlockIndex(list.getCompoundTagAt(i)));
      }
    }

    done = nbttagcompound.getBoolean("done");
    fluidTank.readFromNBT(nbttagcompound);
View Full Code Here

      bptNBT.setTag("builderState", builderCpt);
    }

    if (currentPathIterator != null) {
      NBTTagCompound iteratorNBT = new NBTTagCompound();
      new BlockIndex((int) currentPathIterator.ix,
          (int) currentPathIterator.iy, (int) currentPathIterator.iz)
          .writeTo(iteratorNBT);
      bptNBT.setTag ("iterator", iteratorNBT);
    }
View Full Code Here

  @Override
  public void readEntityFromNBT(NBTTagCompound nbt) {
    super.readEntityFromNBT(nbt);

    NBTTagCompound linkedStationNBT = nbt.getCompoundTag("linkedStation");
    linkedDockingStationIndex = new BlockIndex(linkedStationNBT.getCompoundTag("index"));
    linkedDockingStationSide = ForgeDirection.values()[linkedStationNBT.getByte("side")];

    if (nbt.hasKey("currentStation")) {
      NBTTagCompound currentStationNBT = nbt.getCompoundTag("currentStation");
      currentDockingStationIndex = new BlockIndex(currentStationNBT.getCompoundTag("index"));
      currentDockingStationSide = ForgeDirection.values()[currentStationNBT.getByte("side")];

    }

    laser.readFromNBT(nbt.getCompoundTag("laser"));
View Full Code Here

   * Tries to receive items in parameters, return items that are left after
   * the operation.
   */
  public ItemStack receiveItem(TileEntity tile, ItemStack stack) {
    if (currentDockingStation != null
        && currentDockingStation.index().nextTo(new BlockIndex(tile))
        && mainAI != null) {

      return mainAI.getActiveAI().receiveItem(stack);
    } else {
      return stack;
View Full Code Here

  public ResourceIdBlock() {

  }

  public ResourceIdBlock(int x, int y, int z) {
    index = new BlockIndex(x, y, z);
  }
View Full Code Here

  public ResourceIdBlock(BlockIndex iIndex) {
    index = iIndex;
  }

  public ResourceIdBlock(TileEntity tile) {
    index = new BlockIndex(tile);
  }
View Full Code Here

    LinkedList<BlockIndex> res = new LinkedList<BlockIndex>();

    TilePathMarker nextTile = this;

    while (nextTile != null) {
      BlockIndex b = new BlockIndex(nextTile.xCoord, nextTile.yCoord, nextTile.zCoord);

      visitedPaths.add(b);
      res.add(b);

      if (nextTile.links[0] != null
          && !visitedPaths.contains(new BlockIndex(nextTile.links[0].xCoord, nextTile.links[0].yCoord, nextTile.links[0].zCoord))) {
        nextTile = nextTile.links[0];
      } else if (nextTile.links[1] != null
          && !visitedPaths.contains(new BlockIndex(nextTile.links[1].xCoord, nextTile.links[1].yCoord, nextTile.links[1].zCoord))) {
        nextTile = nextTile.links[1];
      } else {
        nextTile = null;
      }
    }
View Full Code Here

   */
  public abstract boolean isExpectedBlock(World world, int x, int y, int z);

  public final void preemt(AIRobot ai) {
    if (ai instanceof AIRobotSearchBlock) {
      BlockIndex index = ((AIRobotSearchBlock) ai).blockFound;

      if (!robot.getRegistry().isTaken(new ResourceIdBlock(index))) {
        abortDelegateAI();
      }
    }
View Full Code Here

TOP

Related Classes of buildcraft.api.core.BlockIndex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.