Package buildcraft.api.core

Examples of buildcraft.api.core.Position


  }

  @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

  @Override
  public void translateToBlueprint(Translation transform) {
    super.translateToBlueprint(transform);

    Position pos = new Position (entityNBT.getInteger("TileX"), entityNBT.getInteger("TileY"), entityNBT.getInteger("TileZ"));
    pos = transform.translate(pos);
    entityNBT.setInteger("TileX", (int) pos.x);
    entityNBT.setInteger("TileY", (int) pos.y);
    entityNBT.setInteger("TileZ", (int) pos.z);
  }
View Full Code Here

  @Override
  public void translateToWorld(Translation transform) {
    super.translateToWorld(transform);

    Position pos = new Position (entityNBT.getInteger("TileX"), entityNBT.getInteger("TileY"), entityNBT.getInteger("TileZ"));
    pos = transform.translate(pos);
    entityNBT.setInteger("TileX", (int) pos.x);
    entityNBT.setInteger("TileY", (int) pos.y);
    entityNBT.setInteger("TileZ", (int) pos.z);
  }
View Full Code Here

  @Override
  public void rotateLeft(IBuilderContext context) {
    super.rotateLeft(context);

    Position pos = new Position (entityNBT.getInteger("TileX"), entityNBT.getInteger("TileY"), entityNBT.getInteger("TileZ"));
    pos = context.rotatePositionLeft(pos);
    entityNBT.setInteger("TileX", (int) pos.x);
    entityNBT.setInteger("TileY", (int) pos.y);
    entityNBT.setInteger("TileZ", (int) pos.z);
View Full Code Here

    }
  }

  @Override
  public boolean isAlreadyBuilt(IBuilderContext context) {
    Position newPosition = new Position (entityNBT.getInteger("TileX"), entityNBT.getInteger("TileY"), entityNBT.getInteger("TileZ"));

    int dir = entityNBT.getInteger("Direction");

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

      if (e instanceof EntityHanging) {
        EntityHanging h = (EntityHanging) e;
        Position existingPositon = new Position(h.field_146063_b, h.field_146064_c, h.field_146062_d);

        if (existingPositon.isClose(newPosition, 0.1F) && dir == ((EntityHanging) e).hangingDirection) {
          return true;
        }
      }
    }
View Full Code Here

    }
  }

  @Override
  public Position getDestination () {
    return new Position (x + 0.5, y + 0.5, z + 0.5);
  }
View Full Code Here

  }

  private void addSubBlueprint(BlockIndex index) {
    subBlueprints.add(index);

    LaserData laser = new LaserData(new Position(index), new Position(this));

    laser.head.x += 0.5F;
    laser.head.y += 0.5F;
    laser.head.z += 0.5F;
View Full Code Here

      signals = null;
    }
    if (showSignals) {
      signals = new EntityBlock[6];
      if (!origin.isSet() || !origin.vect[0].isSet()) {
        signals[0] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord + maxSize - 1, yCoord, zCoord),
            LaserKind.Blue);
        signals[1] = Utils.createLaser(worldObj, new Position(xCoord - maxSize + 1, yCoord, zCoord), new Position(xCoord, yCoord, zCoord),
            LaserKind.Blue);
      }

      if (!origin.isSet() || !origin.vect[1].isSet()) {
        signals[2] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord, yCoord + maxSize - 1, zCoord),
            LaserKind.Blue);
        signals[3] = Utils.createLaser(worldObj, new Position(xCoord, yCoord - maxSize + 1, zCoord), new Position(xCoord, yCoord, zCoord),
            LaserKind.Blue);
      }

      if (!origin.isSet() || !origin.vect[2].isSet()) {
        signals[4] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord), new Position(xCoord, yCoord, zCoord + maxSize - 1),
            LaserKind.Blue);
        signals[5] = Utils.createLaser(worldObj, new Position(xCoord, yCoord, zCoord - maxSize + 1), new Position(xCoord, yCoord, zCoord),
            LaserKind.Blue);
      }
    }
  }
View Full Code Here

  @Override
  public void readFromNBT(NBTTagCompound nbttagcompound) {
    super.readFromNBT(nbttagcompound);

    if (nbttagcompound.hasKey("vectO")) {
      initVectO = new Position(nbttagcompound.getCompoundTag("vectO"));
      initVect = new Position[3];

      for (int i = 0; i < 3; ++i) {
        if (nbttagcompound.hasKey("vect" + i)) {
          initVect[i] = new Position(nbttagcompound.getCompoundTag("vect" + i));
        }
      }
    }
  }
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.