Examples of Vect


Examples of forestry.core.utils.Vect

  public Collection<ItemStack> collect() {

    Collection<ItemStack> products = produce;
    produce = new ArrayList<ItemStack>();

    Vect coords = new Vect(housing.getCoords());
    Vect area = new Vect(housing.getArea());
    Vect offset = new Vect(housing.getOffset());

    Vect min = coords.add(offset);
    Vect max = coords.add(offset).add(area);

    AxisAlignedBB harvestBox = AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
    List<Entity> list = getWorld().getEntitiesWithinAABB(Entity.class, harvestBox);

    for (Entity entity : list) {
View Full Code Here

Examples of forestry.core.utils.Vect

  @Override
  public Collection<ICrop> harvest(int x, int y, int z, ForgeDirection direction, int extent) {

    Collection<ICrop> crops = null;

    Vect start = new Vect(x, y, z);
    if (!lastExtentsHarvest.containsKey(start))
      lastExtentsHarvest.put(start, 0);

    int lastExtent = lastExtentsHarvest.get(start);
    if (lastExtent > extent)
      lastExtent = 0;

    Vect position = translateWithOffset(x, y + 1, z, direction, lastExtent);
    crops = getHarvestBlocks(position);
    lastExtent++;
    lastExtentsHarvest.put(start, lastExtent);

    return crops;
View Full Code Here

Examples of forestry.core.utils.Vect

    // Get additional candidates to return
    for (int i = -1; i < 2; i++)
      for (int j = yOffset; j < 2; j++)
        for (int k = -1; k < 2; k++) {
          Vect candidate = new Vect(position.x + i, position.y + j, position.z + k);
          if (candidate.equals(position))
            continue;
          if (Math.abs(candidate.x - start.x) > 5)
            continue;
          if (Math.abs(candidate.z - start.z) > 5)
            continue;
View Full Code Here

Examples of forestry.core.utils.Vect

  @Override
  protected boolean maintainGermlings(int x, int ySaplings, int z, ForgeDirection direction, int extent) {

    for (int i = 0; i < extent; i++) {
      Vect position = translateWithOffset(x, ySaplings, z, direction, i);

      if (isAirBlock(position)) {
        Vect soilBelowPosition = new Vect(position.x, position.y - 1, position.z);
        ItemStack soilBelow = getAsItemStack(soilBelowPosition);
        if (isAcceptedGround(soilBelow))
          return plantSapling(position);
      }
    }
View Full Code Here

Examples of forestry.core.utils.Vect

      return null;
    int meta = world.getBlockMetadata(x, y, z);
    if (BlockUtil.getMaturityPod(meta) < 2)
      return null;

    return new CropBlock(world, block, meta, new Vect(x, y, z));
  }
View Full Code Here

Examples of forestry.core.utils.Vect

public abstract class TileForestry extends TileEntity implements INetworkedEntity, IOwnable, IErrorSource {

  protected boolean isInited = false;

  public Vect Coords() {
    return new Vect(xCoord, yCoord, zCoord);
  }
View Full Code Here

Examples of forestry.core.utils.Vect

  public Collection<ICrop> harvest(int x, int y, int z, ForgeDirection direction, int extent) {
    World world = getWorld();

    Stack<ICrop> crops = new Stack<ICrop>();
    for (int i = 0; i < extent; i++) {
      Vect position = translateWithOffset(x, y + 1, z, direction, i);
      for (IFarmable seed : germlings) {
        ICrop crop = seed.getCropAt(world, position.x, position.y, position.z);
        if (crop != null)
          crops.push(crop);
      }
View Full Code Here

Examples of forestry.core.utils.Vect

  }

  @Override
  protected EnumStructureState determineMasterState(Schemata schemata, boolean rotate) {

    Vect dimensions = schemata.getDimensions(rotate);
    int offsetX = schemata.getxOffset();
    int offsetZ = schemata.getzOffset();
    if (rotate) {
      offsetX = schemata.getzOffset();
      offsetZ = schemata.getxOffset();
View Full Code Here

Examples of forestry.core.utils.Vect

    int offset = (expectedGirth - 1) / 2;
    // if(offset <= 0)
    // offset = 1;

    return checkArea(world, new Vect(xPos - offset, yPos + 1, zPos + offset),
        new Vect(-offset + expectedGirth, expectedHeight + 1, -offset + expectedGirth));
  }
View Full Code Here

Examples of forestry.core.utils.Vect

  }

  @Override
  protected EnumStructureState determineMasterState(Schemata schemata, boolean rotate) {

    Vect dimensions = schemata.getDimensions(rotate);
    int offsetX = schemata.getxOffset();
    int offsetZ = schemata.getzOffset();
    if (rotate) {
      offsetX = schemata.getzOffset();
      offsetZ = schemata.getxOffset();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.