Package forestry.api.plugin
Interface IMutationBuilder
public interface IMutationBuilder
Set custom mutation requirements
-
Method Summary
Modifier and TypeMethodDescriptionaddMutationCondition(IMutationCondition condition) Require some other custom mutation condition.<A extends IAllele>
IMutationBuilderaddSpecialAllele(IChromosome<A> chromosome, A allele) build(ISpeciesType<S, ?> speciesType, com.google.common.collect.ImmutableMap<net.minecraft.resources.ResourceLocation, S> speciesLookup) Builds the mutation.Restrict the time of day that this mutation can occurrequireResource(net.minecraft.world.level.block.state.BlockState... acceptedBlockStates) Require a specific resource to be under the location of the mutationrestrictBiomeType(net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome> types) Restrict this mutation to certain types of biomes.restrictDateRange(int startMonth, int startDay, int endMonth, int endDay) Restrict the days of the year that this mutation can occur.default IMutationBuilderrestrictDateRange(Month startMonth, int startDay, Month endMonth, int endDay) Restrict the days of the year that this mutation can occur.restrictHumidity(HumidityType humidity) Require a specific humidity for this mutation to occur.restrictHumidity(HumidityType minHumidity, HumidityType maxHumidity) Require a range of humidities for this mutation to occur.restrictTemperature(TemperatureType temperature) Require a specific temperature for this mutation to occurrestrictTemperature(TemperatureType minTemperature, TemperatureType maxTemperature) Require a range of temperatures for this mutation to occur.setChance(float chance)
-
Method Details
-
restrictTemperature
Require a specific temperature for this mutation to occur -
restrictTemperature
IMutationBuilder restrictTemperature(TemperatureType minTemperature, TemperatureType maxTemperature) Require a range of temperatures for this mutation to occur. -
restrictHumidity
Require a specific humidity for this mutation to occur. -
restrictHumidity
Require a range of humidities for this mutation to occur. -
restrictBiomeType
IMutationBuilder restrictBiomeType(net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome> types) Restrict this mutation to certain types of biomes. -
restrictDateRange
default IMutationBuilder restrictDateRange(Month startMonth, int startDay, Month endMonth, int endDay) Restrict the days of the year that this mutation can occur. -
restrictDateRange
Restrict the days of the year that this mutation can occur. -
requireDay
IMutationBuilder requireDay()Restrict the time of day that this mutation can occur -
requireNight
IMutationBuilder requireNight() -
requireResource
IMutationBuilder requireResource(net.minecraft.world.level.block.state.BlockState... acceptedBlockStates) Require a specific resource to be under the location of the mutation -
addMutationCondition
Require some other custom mutation condition. -
addSpecialAllele
-
setChance
Override the chance set inIMutationsRegistration.add(net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation, float).- Parameters:
chance- The chance of this mutation occurring between 0 and 1, inclusive.- Throws:
IllegalArgumentException- If chance is not in [0, 1].
-
build
<S extends ISpecies<?>> IMutation<S> build(ISpeciesType<S, ?> speciesType, com.google.common.collect.ImmutableMap<net.minecraft.resources.ResourceLocation, S> speciesLookup) Builds the mutation. Used internally.- Parameters:
speciesType- Species type of the mutation. Do not callISpeciesType.getSpecies(net.minecraft.resources.ResourceLocation).speciesLookup- The species by ID lookup, since species type might not have the registry yet.- Returns:
- The completed Mutation object with immutable data.
-