use of forestry.api.climate.IClimateState in project Binnie by ForestryMC.
the class GardeningManager method getBiomeMoisture.
@Override
public float getBiomeMoisture(World world, BlockPos pos) {
IClimateState info = ForestryAPI.climateManager.getClimateState(world, pos);
double humidity = info.getHumidity();
double temperature = info.getTemperature();
double moisture = 3.2 * (humidity - 0.5) - 0.4 * (1.0 + temperature + 0.5 * temperature * temperature) + 1.1 - 1.6 * (temperature - 0.9) * (temperature - 0.9) - 0.002 * (pos.getY() - 64);
return (float) ((moisture == 0.0) ? moisture : ((moisture < 0.0) ? (-Math.sqrt(moisture * moisture)) : Math.sqrt(moisture * moisture)));
}
Aggregations