Package buildcraft.api.core

Examples of buildcraft.api.core.Position


  }

  @Override
  public void translateToBlueprint(Translation transform) {
    NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
    Position pos = new Position(nbttaglist.func_150309_d(0),
        nbttaglist.func_150309_d(1), nbttaglist.func_150309_d(2));
    pos = transform.translate(pos);

    entityNBT.setTag("Pos",
        this.newDoubleNBTList(pos.x, pos.y, pos.z));
View Full Code Here


  }

  @Override
  public void translateToWorld(Translation transform) {
    NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
    Position pos = new Position(nbttaglist.func_150309_d(0),
        nbttaglist.func_150309_d(1), nbttaglist.func_150309_d(2));
    pos = transform.translate(pos);

    entityNBT.setTag("Pos",
        this.newDoubleNBTList(pos.x, pos.y, pos.z));
View Full Code Here

  }

  @Override
  public void rotateLeft(IBuilderContext context) {
    NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
    Position pos = new Position(nbttaglist.func_150309_d(0),
        nbttaglist.func_150309_d(1), nbttaglist.func_150309_d(2));
    pos = context.rotatePositionLeft(pos);
    entityNBT.setTag("Pos",
        this.newDoubleNBTList(pos.x, pos.y, pos.z));
View Full Code Here

    return nbttaglist;
  }

  public boolean isAlreadyBuilt(IBuilderContext context) {
    NBTTagList nbttaglist = entityNBT.getTagList("Pos", 6);
    Position newPosition = new Position(nbttaglist.func_150309_d(0),
        nbttaglist.func_150309_d(1), nbttaglist.func_150309_d(2));

    for (Object o : context.world().loadedEntityList) {
      Entity e = (Entity) o;

      Position existingPositon = new Position(e.posX, e.posY, e.posZ);

      if (existingPositon.isClose(newPosition, 0.1F)) {
        return true;
      }
    }

    return false;
View Full Code Here

    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      if (from != ForgeDirection.UNKNOWN && from != dir.getOpposite())
        continue;

      Position posPipe = new Position(blockPos.x, blockPos.y, blockPos.z, dir);
      posPipe.moveForwards(1.0);

      TileEntity pipeEntry = world.getTileEntity((int) posPipe.x, (int) posPipe.y, (int) posPipe.z);

      if (pipeEntry instanceof IPipeTile) {
        IPipeTile pipe = (IPipeTile)pipeEntry;
View Full Code Here

      return false;
    if (pipes.size() <= 0)
      return false;

    int choice = tile.getWorldObj().rand.nextInt(pipes.size());
    Position itemPos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, pipes.get(choice));

    itemPos.x += 0.5;
    itemPos.y += 0.25;
    itemPos.z += 0.5;
    itemPos.moveForwards(0.5);

    Position pipePos = new Position(tile.xCoord, tile.yCoord, tile.zCoord, pipes.get(choice));
    pipePos.moveForwards(1.0);

    IPipeTile pipe = (IPipeTile) tile.getWorldObj().getTileEntity((int) pipePos.x, (int) pipePos.y, (int) pipePos.z);

    ItemStack payload = stack.splitStack(1);
    if(pipe.injectItem(payload, true, itemPos.orientation.getOpposite()) > 0)
View Full Code Here

      if (item.getContainer() != this.container) {
        items.scheduleRemoval(item);
        continue;
      }

      Position motion = new Position(0, 0, 0, item.toCenter ? item.input : item.output);
      motion.moveForwards(item.getSpeed());

      item.movePosition(motion.x, motion.y, motion.z);

      if ((item.toCenter && middleReached(item)) || outOfBounds(item)) {
        item.toCenter = false;
View Full Code Here

  protected boolean outOfBounds(TravelingItem item) {
    return item.xCoord > container.xCoord + 2 || item.xCoord < container.xCoord - 1 || item.yCoord > container.yCoord + 2 || item.yCoord < container.yCoord - 1 || item.zCoord > container.zCoord + 2 || item.zCoord < container.zCoord - 1;
  }

  public Position getPosition() {
    return new Position(container.xCoord, container.yCoord, container.zCoord);
  }
View Full Code Here

    }

    if (slot != null) {
      slot.built = true;
      BuildingItem i = new BuildingItem();
      i.origin = new Position(x, y, z);
      i.destination = slot.getDestination();
      i.slotToBuild = slot;
      i.context = getContext();
      i.setStacksToDisplay(slot.getStacksToDisplay());
      builder.addAndLaunchBuildingItem(i);
View Full Code Here

    return contains(i.x, i.y, i.z);
  }

  @Override
  public Position pMin() {
    return new Position(xMin, yMin, zMin);
  }
View Full Code Here

TOP

Related Classes of buildcraft.api.core.Position

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.