Package forestry.api.arboriculture

Examples of forestry.api.arboriculture.EnumGrowthConditions


public class GrowthProviderTropical extends GrowthProvider {

  @Override
  public EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos) {
    EnumGrowthConditions light = getConditionFromLight(world, xPos, yPos, zPos);
    EnumGrowthConditions moisture = getConditionsFromRainfall(world, xPos, yPos, zPos, BiomeGenBase.jungle.rainfall, 2.0f);
    EnumGrowthConditions temperature = getConditionsFromTemperature(world, xPos, yPos, zPos, BiomeGenBase.jungle.temperature, BiomeGenBase.desert.temperature - 0.1f);

    EnumSet<EnumGrowthConditions> conditions = EnumSet.of(light, moisture, temperature);

    EnumGrowthConditions result = EnumGrowthConditions.HOSTILE;
    for (EnumGrowthConditions cond : conditions) {
      if (cond == EnumGrowthConditions.HOSTILE)
        return EnumGrowthConditions.HOSTILE;

      if (cond.ordinal() > result.ordinal())
        result = cond;
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of forestry.api.arboriculture.EnumGrowthConditions

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.