Package forestry.api.genetics
Interface IMutationCondition
public interface IMutationCondition
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentA localized description of the mutation condition.floatmodifyChance(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, IMutation<?> mutation, IGenome firstGenome, IGenome secondGenome, IClimateProvider climate, float currentChance) Used to modify the chance of a mutation based on certain conditions being met.
-
Method Details
-
modifyChance
float modifyChance(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, IMutation<?> mutation, IGenome firstGenome, IGenome secondGenome, IClimateProvider climate, float currentChance) Used to modify the chance of a mutation based on certain conditions being met. Most conditions will either return the current chance or0.0fif the condition is not met.- Parameters:
level- The world.pos- The position where this mutation is taking place.mutation- The mutation.firstGenome- The genome of one parent in the mutation. Order of genomes does not necessarily matchmutation.secondGenome- The genome of the other parent in the mutation. Order of genomes does not necessarily matchmutation.climate- The climate in which this mutation is taking place.currentChance- The current chance. Starts out as the base chance of the mutation, but may be modified by otherIMutationCondition.- Returns:
- The new mutation chance. Usually
currentChanceif the condition is met,0.0fif it is not.
-
getDescription
net.minecraft.network.chat.Component getDescription()A localized description of the mutation condition. (i.e. "A temperature of HOT is required.")
-