Package forestry.api.core.genetics
Interface IMutationCondition
public interface IMutationCondition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<IMutationCondition> static final com.mojang.serialization.Codec<List<IMutationCondition>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, List<IMutationCondition>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, 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.type()
-
Field Details
-
CODEC
-
STREAM_CODEC
static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,IMutationCondition> STREAM_CODEC -
LIST_CODEC
-
LIST_STREAM_CODEC
static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,List<IMutationCondition>> LIST_STREAM_CODEC
-
-
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.") -
type
MutationConditionType<?> type()- Returns:
- The type of this mutation condition, used to (de)serialize it via a dispatch codec.
-