Package buildcraft.api.core

Examples of buildcraft.api.core.Position


    return new Position(xMin, yMin, zMin);
  }

  @Override
  public Position pMax() {
    return new Position(xMax, yMax, zMax);
  }
View Full Code Here


    for (NBTTagCompound sub : subBlueprintsNBT) {
      ForgeDirection dir = ForgeDirection.values()[sub.getByte("dir")];

      dir = dir.getRotation(ForgeDirection.UP);

      Position pos = new Position(sub.getInteger("x"), sub.getInteger("y"), sub.getInteger("z"));
      Position np = context.rotatePositionLeft(pos);

      sub.setInteger("x", (int) np.x);
      sub.setInteger("z", (int) np.z);
      sub.setByte("dir", (byte) dir.ordinal());
View Full Code Here

    this.mappingRegistry = registry;
  }

  @Override
  public Position rotatePositionLeft(Position pos) {
    return new Position((box.sizeZ() - 1) - pos.z, pos.y, pos.x);
  }
View Full Code Here

    if (laser == null) {
      laser = new LaserData();
    }
   
    laser.isVisible = false;
    laser.head = new Position(xCoord, yCoord, zCoord);
    laser.tail = new Position(xCoord, yCoord, zCoord);
  }
View Full Code Here

      default:
        pz = LASER_OFFSET;
        break;
    }

    Position head = new Position(xCoord + 0.5 + px, yCoord + 0.5 + py, zCoord + 0.5 + pz);
    Position tail = new Position(laserTarget.getXCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F, laserTarget.getYCoord() + 9F / 16F,
        laserTarget.getZCoord() + 0.475 + (worldObj.rand.nextFloat() - 0.5) / 5F);

    laser.head = head;
    laser.tail = tail;
View Full Code Here

    nbt.setDouble("tailZ", data.tail.z);
  }

  // Workaround for the laser's posY loosing it's precision e.g 103.5 becomes 104
  public Position renderOffset() {
    return new Position(data.head.x - posX, data.head.y - posY, data.head.z - posZ);
  }
View Full Code Here

          battery.useEnergy(10, 10, false);

          continue;
        }

        Position entityPos = new Position(tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, side.getOpposite());

        entityPos.moveForwards(0.6);

        TravelingItem entity = makeItem(entityPos.x, entityPos.y, entityPos.z, stack);

        transport.injectItem(entity, entityPos.orientation);
      }
View Full Code Here

  @Override
  public boolean onItemUse(ItemStack stack, EntityPlayer player, World worldObj, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    if (worldObj.isRemote) {
      return false;
    }
    Position pos = new Position(x, y, z, ForgeDirection.getOrientation(side));
    pos.moveForwards(1.0);

    TileEntity tile = worldObj.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
    if (!(tile instanceof TileGenericPipe)) {
      return false;
    }
View Full Code Here

  }

  @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

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.