Package buildcraft.api.core

Examples of buildcraft.api.core.Position


  @Override
  public void transformToBlueprint(MappingRegistry registry,
      Translation transform) {
    NBTTagList nbttaglist = cpt.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);

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


  }

  @Override
  public void transformToWorld(MappingRegistry registry, Translation transform) {
    NBTTagList nbttaglist = cpt.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);

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

  }

  @Override
  public void rotateLeft(IBuilderContext context) {
    NBTTagList nbttaglist = cpt.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);
    cpt.setTag("Pos",
        this.newDoubleNBTList(pos.x, pos.y, pos.z));
View Full Code Here

    return nbttaglist;
  }

  public boolean isAlreadyBuilt(IBuilderContext context) {
    NBTTagList nbttaglist = cpt.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

    LinkedList<TileGenericPipe> neighbours = new LinkedList<TileGenericPipe>();
    neighbours.add(this.container);

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

      TileEntity tile = container.getTile(o);

      if (tile instanceof TileGenericPipe) {
        TileGenericPipe pipe = (TileGenericPipe) tile;
View Full Code Here

    LinkedList<TileGenericPipe> neighbours = new LinkedList<TileGenericPipe>();
    neighbours.add(this.container);

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

      TileEntity tile = container.getTile(o);

      if (tile instanceof TileGenericPipe) {
        TileGenericPipe pipe = (TileGenericPipe) tile;
View Full Code Here

        if (stack != null) {
          // System.out.println("out: Stack " + stack.toString());

          stack.stackSize -= Utils.addToRandomPipeAround(container.worldObj, container.xCoord, container.yCoord, container.zCoord, receivedStack.getKey(), stack);
          if (stack.stackSize > 0) {
            Position destPos = new Position(container.xCoord, container.yCoord, container.zCoord, receivedStack.getKey());

            destPos.moveForwards(0.3);

            InvUtils.dropItems(container.worldObj, stack, (int) destPos.x, (int) destPos.y, (int) destPos.z);
          }

        }
View Full Code Here

  public void doWork(PowerHandler workProvider) {
    if (workProvider.useEnergy(powerToBreakABlock, powerToBreakABlock, true) == powerToBreakABlock) {
      ForgeDirection o = getOpenOrientation();

      if (o != ForgeDirection.UNKNOWN) {
        Position p = new Position(container.xCoord, container.yCoord, container.zCoord, o);
        p.moveForwards(1.0);

        List<ItemStack> stacks = BlockUtil.getItemStackFromBlock(container.worldObj, (int) p.x, (int) p.y, (int) p.z);

        if (stacks != null) {
          for (ItemStack s : stacks) {
View Full Code Here

  }

  @Override
  public void drop(PipeTransportItems pipe, TravelingItem item) {
    Position p = new Position(container.xCoord, container.yCoord, container.zCoord, item.output);
    p.moveForwards(1.0);

    /*
     * if (convertPipe(pipe, data)) if(CoreProxy.proxy.isSimulating(worldObj)) BuildCraftTransport.pipeItemsStipes.onItemUseFirst(new
     * ItemStack(BuildCraftTransport.pipeItemsStipes), CoreProxy.proxy.getBuildCraftPlayer(worldObj), worldObj, (int) p.x, (int) p.y - 1, (int) p.z, 1);
     * else
 
View Full Code Here

    LinkedList<TileGenericPipe> neighbours = new LinkedList<TileGenericPipe>();
    neighbours.add(this.container);

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

      TileEntity tile = container.getTile(o);

      if (tile instanceof TileGenericPipe) {
        TileGenericPipe pipe = (TileGenericPipe) tile;
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.