Package buildcraft.api.core

Examples of buildcraft.api.core.Position


    nbt.setTag("slotToBuild", slotNBT);
  }

  public void readFromNBT(NBTTagCompound nbt) throws MappingNotFoundException {
    origin = new Position(nbt.getCompoundTag("origin"));
    destination = new Position (nbt.getCompoundTag("destination"));
    lifetime = nbt.getDouble("lifetime");

    NBTTagList items = nbt.getTagList("items",
        Constants.NBT.TAG_COMPOUND);
View Full Code Here


    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
    GL11.glDisable(GL11.GL_LIGHTING);

    Position offset = laser.renderOffset();
    GL11.glTranslated(x + offset.x, y + offset.y, z + offset.z);

    // FIXME: WARNING! not using getBox (laser) will kill laser movement.
    // we can use some other method for the animation though.
    doRenderLaser(renderManager.renderEngine, laser.data, laser.getTexture());
View Full Code Here

    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(
            b.x + 0.5, b.y + 0.5, b.z + 0.5));

        pathLasers.add(laser);
      }
View Full Code Here

  }

  @Override
  public Position getDestination () {
    NBTTagList nbttaglist = schematic.entityNBT.getTagList("Pos", 6);
    Position pos = new Position(nbttaglist.func_150309_d(0),
        nbttaglist.func_150309_d(1), nbttaglist.func_150309_d(2));

    return pos;
  }
View Full Code Here

      int oy = nbt.getInteger("y");
      int oz = nbt.getInteger("z");

      TileEntity tile1 = world.getTileEntity(ox, oy, oz);

      if (!new Position(ox, oy, oz).isClose(new Position(x, y, z), 64)) {
        return;
      }

      if (tile1 != null && (tile1 instanceof TileArchitect)) {
        TileArchitect architect = (TileArchitect) tile1;
View Full Code Here

  @Override
  public void translateToBlueprint(Translation transform) {
    super.translateToBlueprint(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.x -= 0.5;
    pos.z -= 0.5;
    entityNBT.setTag("Pos", this.newDoubleNBTList(new double[] {pos.x, pos.y, pos.z}));
  }
View Full Code Here

  @Override
  public void translateToWorld(Translation transform) {
    super.translateToWorld(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.x += 0.5;
    pos.z += 0.5;
    entityNBT.setTag("Pos", this.newDoubleNBTList(new double[] {pos.x, pos.y, pos.z}));
  }
View Full Code Here

  }

  @Override
  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 (e instanceof EntityMinecart) {
        if (existingPositon.isClose(newPosition, 0.1F)) {
          return true;
        }
      }
    }
View Full Code Here

    if (worldObj.isRemote) {
      return;
    }

    LaserData laser = new LaserData
        (new Position(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5),
           new Position(pathMarker.xCoord + 0.5, pathMarker.yCoord + 0.5, pathMarker.zCoord + 0.5));

    LaserData laser2 = new LaserData (laser.head, laser.tail);
    laser2.isVisible = false;

    connect(pathMarker, laser);
View Full Code Here

  private AxisAlignedBB getSuckingBox(ForgeDirection orientation, int distance) {
    if (orientation == ForgeDirection.UNKNOWN) {
      return null;
    }
    Position p1 = new Position(container.xCoord, container.yCoord, container.zCoord, orientation);
    Position p2 = new Position(container.xCoord, container.yCoord, container.zCoord, orientation);

    switch (orientation) {
      case EAST:
        p1.x += distance;
        p2.x += 1 + distance;
        break;
      case WEST:
      p1.x -= distance - 1;
        p2.x -= distance;
        break;
      case UP:
      case DOWN:
        p1.x += distance + 1;
        p2.x -= distance;
        p1.z += distance + 1;
        p2.z -= distance;
        break;
      case SOUTH:
        p1.z += distance;
        p2.z += distance + 1;
        break;
      case NORTH:
      default:
      p1.z -= distance - 1;
        p2.z -= distance;
        break;
    }

    switch (orientation) {
      case EAST:
      case WEST:
        p1.y += distance + 1;
        p2.y -= distance;
        p1.z += distance + 1;
        p2.z -= distance;
        break;
      case UP:
        p1.y += distance + 1;
        p2.y += distance;
        break;
      case DOWN:
      p1.y -= distance - 1;
        p2.y -= distance;
        break;
      case SOUTH:
      case NORTH:
      default:
        p1.y += distance + 1;
        p2.y -= distance;
        p1.x += distance + 1;
        p2.x -= distance;
        break;
    }

    Position min = p1.min(p2);
    Position max = p1.max(p2);

    return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.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.