Search in sources :

Example 11 with EnumHumidity

use of forestry.api.core.EnumHumidity in project ForestryMC by ForestryMC.

the class ClimateGrowthProvider method isBiomeValid.

@Override
public boolean isBiomeValid(ITree tree, Biome biome) {
    EnumTemperature biomeTemperature = EnumTemperature.getFromBiome(biome);
    EnumHumidity biomeHumidity = EnumHumidity.getFromValue(biome.getRainfall());
    ITreeGenome genome = tree.getGenome();
    if (temperature == null) {
        temperature = genome.getPrimary().getTemperature();
    }
    if (humidity == null) {
        humidity = genome.getPrimary().getHumidity();
    }
    return AlleleManager.climateHelper.isWithinLimits(biomeTemperature, biomeHumidity, temperature, temperatureTolerance, humidity, humidityTolerance);
}
Also used : EnumHumidity(forestry.api.core.EnumHumidity) ITreeGenome(forestry.api.arboriculture.ITreeGenome) EnumTemperature(forestry.api.core.EnumTemperature)

Aggregations

EnumHumidity (forestry.api.core.EnumHumidity)11 EnumTemperature (forestry.api.core.EnumTemperature)9 Biome (net.minecraft.world.biome.Biome)5 IErrorState (forestry.api.core.IErrorState)3 EnumTolerance (forestry.api.genetics.EnumTolerance)3 HashSet (java.util.HashSet)3 BlockPos (net.minecraft.util.math.BlockPos)3 World (net.minecraft.world.World)3 IAlleleButterflySpecies (forestry.api.lepidopterology.IAlleleButterflySpecies)2 IAlleleBeeSpecies (forestry.api.apiculture.IAlleleBeeSpecies)1 IBeeGenome (forestry.api.apiculture.IBeeGenome)1 IBeeModifier (forestry.api.apiculture.IBeeModifier)1 ITreeGenome (forestry.api.arboriculture.ITreeGenome)1 ArrayList (java.util.ArrayList)1 Minecraft (net.minecraft.client.Minecraft)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1