Package buildcraft.api.core

Examples of buildcraft.api.core.Position


   * @return amount used
   */
  public static int addToRandomInventoryAround(World world, int x, int y, int z, ItemStack stack) {
    Collections.shuffle(directions);
    for (ForgeDirection orientation : directions) {
      Position pos = new Position(x, y, z, orientation);
      pos.moveForwards(1.0);

      TileEntity tileInventory = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
      ITransactor transactor = Transactor.getTransactorFor(tileInventory);
      if (transactor != null && !(tileInventory instanceof TileEngine) && transactor.add(stack, orientation.getOpposite(), false).stackSize > 0) {
        return transactor.add(stack, orientation.getOpposite(), true).stackSize;
View Full Code Here


    for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
      if (from.getOpposite() == side) {
        continue;
      }

      Position pos = new Position(x, y, z, side);

      pos.moveForwards(1.0);

      TileEntity tile = world.getTileEntity((int) pos.x, (int) pos.y, (int) pos.z);

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

    }
    return 0;
  }

  public static TileEntity getTile(World world, Position pos, ForgeDirection step) {
    Position tmp = new Position(pos);
    tmp.orientation = step;
    tmp.moveForwards(1.0);

    return world.getTileEntity((int) tmp.x, (int) tmp.y, (int) tmp.z);
  }
View Full Code Here

  public static EntityBlock[] createLaserBox(World world, double xMin, double yMin, double zMin, double xMax, double yMax, double zMax, LaserKind kind) {
    EntityBlock[] lasers = new EntityBlock[12];
    Position[] p = new Position[8];

    p[0] = new Position(xMin, yMin, zMin);
    p[1] = new Position(xMax, yMin, zMin);
    p[2] = new Position(xMin, yMax, zMin);
    p[3] = new Position(xMax, yMax, zMin);
    p[4] = new Position(xMin, yMin, zMax);
    p[5] = new Position(xMax, yMin, zMax);
    p[6] = new Position(xMin, yMax, zMax);
    p[7] = new Position(xMax, yMax, zMax);

    lasers[0] = Utils.createLaser(world, p[0], p[1], kind);
    lasers[1] = Utils.createLaser(world, p[0], p[2], kind);
    lasers[2] = Utils.createLaser(world, p[2], p[3], kind);
    lasers[3] = Utils.createLaser(world, p[1], p[3], kind);
View Full Code Here

  public static LaserData[] createLaserDataBox(double xMin, double yMin, double zMin, double xMax, double yMax, double zMax) {
    LaserData[] lasers = new LaserData[12];
    Position[] p = new Position[8];

    p[0] = new Position(xMin, yMin, zMin);
    p[1] = new Position(xMax, yMin, zMin);
    p[2] = new Position(xMin, yMax, zMin);
    p[3] = new Position(xMax, yMax, zMin);
    p[4] = new Position(xMin, yMin, zMax);
    p[5] = new Position(xMax, yMin, zMax);
    p[6] = new Position(xMin, yMax, zMax);
    p[7] = new Position(xMax, yMax, zMax);

    lasers[0] = new LaserData (p[0], p[1]);
    lasers[1] = new LaserData (p[0], p[2]);
    lasers[2] = new LaserData (p[2], p[3]);
    lasers[3] = new LaserData (p[1], p[3]);
View Full Code Here

  protected boolean needsUpdate = true;

  public EntityLaser(World world) {
    super(world);

    data.head = new Position(0, 0, 0);
    data.tail = new Position(0, 0, 0);
  }
View Full Code Here

  protected void readEntityFromNBT(NBTTagCompound nbt) {

    double headX = nbt.getDouble("headX");
    double headY = nbt.getDouble("headZ");
    double headZ = nbt.getDouble("headY");
    data.head = new Position(headX, headY, headZ);

    double tailX = nbt.getDouble("tailX");
    double tailY = nbt.getDouble("tailZ");
    double tailZ = nbt.getDouble("tailY");
    data.tail = new Position(tailX, tailY, tailZ);
  }
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.