Examples of Vect


Examples of forestry.core.utils.Vect

    return storedData;
  }

  protected AxisAlignedBB getBounding(int x, int y, int z, float modifier) {
    int[] areaAr = DEFAULT_EFFECT_AREA;
    Vect area = new Vect(areaAr[0], areaAr[1], areaAr[2]).multiply(modifier);
    Vect offset = new Vect(-Math.round(area.x / 2), -Math.round(area.y / 2), -Math.round(area.z / 2));

    Vect min = new Vect(x + offset.x, y + offset.y, y + offset.z);
    Vect max = new Vect(x + offset.x + area.x, y + offset.y + area.y, y + offset.z + area.z);

    return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
  }
View Full Code Here

Examples of forestry.core.utils.Vect

  public Collection<ICrop> harvest(int x, int y, int z, ForgeDirection direction, int extent) {
    if (inActive)
      return null;

    Collection<ICrop> crops = null;
    Vect start = new Vect(x, y, z);
    if (!lastExtents.containsKey(start))
      lastExtents.put(start, 0);

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

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

    return crops;
View Full Code Here

Examples of forestry.core.utils.Vect

    ArrayList<Vect> candidates = new ArrayList<Vect>();

    // Get additional candidates to return
    for (int j = 0; j < 2; j++) {
      Vect candidate = new Vect(position.x, position.y + j, position.z);
      if (candidate.equals(position))
        continue;

      // See whether the given position has already been processed
      if (seen.contains(candidate))
        continue;
View Full Code Here

Examples of forestry.core.utils.Vect

  private boolean maintainSoil(int x, int yGround, int z, ForgeDirection direction, int extent) {
    if (!housing.hasResources(resource))
      return false;

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

      ItemStack stack = getAsItemStack(position);
      if (isAcceptedGround(stack) || !canBreakGround(getBlock(position)))
        continue;
View Full Code Here

Examples of forestry.core.utils.Vect

      return null;

    if (world.getBlockMetadata(x, y, z) != fruit.getItemDamage())
      return null;

    return new CropBlock(world, StackUtils.getBlock(fruit), fruit.getItemDamage(), new Vect(x, y, z));
  }
View Full Code Here

Examples of forestry.core.utils.Vect

    if (tile == null)
      return null;
    if (PluginFarmCraftory.getGrowthStage(tile) < 2)
      return null;

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

Examples of forestry.core.utils.Vect

    Block block = world.getBlock(x, y, z);

    if (block.isAir(world, x, y, z) || !block.isWood(world, x, y, z))
      return null;

    return new CropBlock(world, block, world.getBlockMetadata(x, y, z), new Vect(x, y, z));
  }
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, z, direction, i);
      ItemStack occupant = getAsItemStack(position);

      if (occupant == null)
        continue;
View Full Code Here

Examples of forestry.core.utils.Vect

  private ChunkCoordinates findNearestBiome(EntityPlayer player, ArrayList<Integer> biomesToSearch) {

    int loadChunkDistance = 25;
    ChunkCoordinates coordinates = null;
    Vect pos = new Vect((int) player.posX, (int) player.posY, (int) player.posZ);
    for (int i = 0; i < 100; i++) {
      // Test direction +X
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(10 * i, 0, 0)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
      // Test direction +X+Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(10 * i, 0, 10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
      // Test direction +X-Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(10 * i, 0, -10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;

      // Test direction -X
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(-10 * i, 0, 0)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
      // Test direction -X+Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(-10 * i, 0, 10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
      // Test direction -X-Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(-10 * i, 0, -10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;

      // Test direction +Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(0, 0, 10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
      // Test direction -Z
      if ((coordinates = getChunkCoordinates(pos.add(new Vect(0, 0, -10 * i)), player.worldObj, biomesToSearch, i < loadChunkDistance)) != null)
        return coordinates;
    }
    return coordinates;
  }
View Full Code Here

Examples of forestry.core.utils.Vect

  private boolean maintainSoil(int x, int y, int z, ForgeDirection direction, int extent) {

    World world = getWorld();

    for (int i = 0; i < extent; i++) {
      Vect position = translateWithOffset(x, y, z, direction, i);
      if (!isAirBlock(position) && !Utils.isReplaceableBlock(world, position.x, position.y, position.z)) {

        ItemStack block = getAsItemStack(position);
        if (!isAcceptedGround(block) && housing.hasResources(resource)) {
          produce.addAll(BlockUtil.getBlockItemStack(getWorld(), position));
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.