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;
}