Search in sources :

Example 16 with IBeeModifier

use of forestry.api.apiculture.IBeeModifier in project ForestryMC by ForestryMC.

the class BeekeepingMode method isDegenerating.

@Override
public boolean isDegenerating(IBee queen, IBee offspring, IBeeHousing housing) {
    IBeeModifier beeModifier = BeeManager.beeRoot.createBeeHousingModifier(housing);
    float mutationModifier = beeModifier.getMutationModifier(queen.getGenome(), queen.getMate(), 1.0f);
    if (mutationModifier > 10) {
        if (housing.getWorldObj().rand.nextFloat() * 100 < 0.4 * (mutationModifier * mutationModifier - 100)) {
            return true;
        }
    }
    return false;
}
Also used : IBeeModifier(forestry.api.apiculture.IBeeModifier)

Aggregations

IBeeModifier (forestry.api.apiculture.IBeeModifier)16 BlockPos (net.minecraft.util.math.BlockPos)7 World (net.minecraft.world.World)7 Vec3i (net.minecraft.util.math.Vec3i)6 Random (java.util.Random)3 ItemStack (net.minecraft.item.ItemStack)3 IAlleleBeeSpecies (forestry.api.apiculture.IAlleleBeeSpecies)2 IBeeListener (forestry.api.apiculture.IBeeListener)2 IBeekeepingMode (forestry.api.apiculture.IBeekeepingMode)2 IHiveFrame (forestry.api.apiculture.IHiveFrame)2 ICheckPollinatable (forestry.api.genetics.ICheckPollinatable)2 IAlvearyComponent (forestry.api.multiblock.IAlvearyComponent)2 AlvearyBeeModifier (forestry.apiculture.AlvearyBeeModifier)2 ArrayList (java.util.ArrayList)2 EnumHumidity (forestry.api.core.EnumHumidity)1 EnumTemperature (forestry.api.core.EnumTemperature)1 IErrorState (forestry.api.core.IErrorState)1 EnumTolerance (forestry.api.genetics.EnumTolerance)1 IFlowerProvider (forestry.api.genetics.IFlowerProvider)1 IIndividual (forestry.api.genetics.IIndividual)1