Package forestry.core.utils

Examples of forestry.core.utils.Vect


    return area;
  }

  protected AxisAlignedBB getBounding(IBeeGenome genome, IBeeHousing housing, float modifier) {
    int[] areaAr = genome.getTerritory();
    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));

    // Radioactivity hurts players and mobs
    Vect min = new Vect(housing.getXCoord() + offset.x, housing.getYCoord() + offset.y, housing.getZCoord() + offset.z);
    Vect max = new Vect(housing.getXCoord() + offset.x + area.x, housing.getYCoord() + offset.y + area.y, housing.getZCoord() + offset.z + area.z);

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


    return ((IAlleleInteger) getActiveAllele(EnumBeeChromosome.FLOWERING.ordinal())).getValue();
  }

  @Override
  public int[] getTerritory() {
    Vect area = ((AlleleArea) getActiveAllele(EnumBeeChromosome.TERRITORY.ordinal())).getArea();
    return new int[] { area.x, area.y, area.z };
  }
View Full Code Here

      resetStructureBlocks(schematas[activeSchemata]);
  }

  protected void resetStructureBlocks(Schemata schemata) {

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

        }
  }

  protected void markStructureBlocks(Schemata schemata) {

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

      return storedData;
    default:
    }

    int[] areaAr = genome.getTerritory();
    Vect area = new Vect(areaAr[0], areaAr[1], areaAr[2]);
    Vect offset = new Vect(-Math.round(area.x / 2), -Math.round(area.y / 2), -Math.round(area.z / 2));

    for (int i = 0; i < 10; i++) {

      Vect randomPos = new Vect(world.rand.nextInt(area.x), world.rand.nextInt(area.y), world.rand.nextInt(area.z));

      Vect posBlock = randomPos.add(new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord()));
      posBlock = posBlock.add(offset);

      // Freeze water
      Block block = world.getBlock(posBlock.x, posBlock.y, posBlock.z);
      if (block != Blocks.water)
        continue;
View Full Code Here

    if (emcRequired <= 0)
      return chance;

    World world = housing.getWorld();

    Vect[] possibleTargets = new Vect[] { new Vect(housing.getXCoord() + 1, housing.getYCoord(), housing.getZCoord()),
        new Vect(housing.getXCoord() - 1, housing.getYCoord(), housing.getZCoord()),
        new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord() + 1),
        new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord() - 1) };

    for (Vect target : possibleTargets) {
      if (!world.blockExists(target.x, target.y, target.z))
        continue;
View Full Code Here

  BlockType wood;
  BlockType vine = new BlockType(Blocks.vine, 0);
  BlockType air = new BlockTypeVoid();

  public final Vect getStartVector() {
    return new Vect(startX, startY, startZ);
  }
View Full Code Here

        .getGenome().getInactiveAllele(EnumBeeChromosome.FERTILITY.ordinal()).isDominant()), 0);

    newLine();

    int[] areaAr = bee.getGenome().getTerritory();
    Vect area = new Vect(areaAr[0], areaAr[1], areaAr[2]);
    drawRow(StringUtil.localize("gui.area"), area.toString(), ((AlleleArea) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TERRITORY.ordinal()))
        .getArea().toString(), bee, EnumBeeChromosome.TERRITORY);

    drawRow(StringUtil.localize("gui.effect"), bee.getGenome().getEffect().getName(),
        ((IAlleleBeeEffect) bee.getGenome().getInactiveAllele(EnumBeeChromosome.EFFECT.ordinal())).getName(), bee,
        EnumBeeChromosome.EFFECT);
View Full Code Here

  public int[] getValue() {
    return area;
  }

  public Vect getArea() {
    return new Vect(area);
  }
View Full Code Here

TOP

Related Classes of forestry.core.utils.Vect

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.