Class BiomeSpecificWeightedGeneList
java.lang.Object
com.hexagram2021.chromosomelib.registry.BiomeSpecificWeightedGeneList
- All Implemented Interfaces:
IWeightedGeneList
Biome-specific weighted gene list.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for BiomeSpecificWeightedGeneList.Nested classes/interfaces inherited from interface com.hexagram2021.chromosomelib.registry.IWeightedGeneList
IWeightedGeneList.Context, IWeightedGeneList.Entry, IWeightedGeneList.WeightedGeneListFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>,IWeightedGeneList> Biome-specific gene lists - each biome has its own gene list.protected final IWeightedGeneListCommon gene list - all biomes share the same gene list.Fields inherited from interface com.hexagram2021.chromosomelib.registry.IWeightedGeneList
EMPTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBiomeSpecificWeightedGeneList(IWeightedGeneList commonList, Map<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>, IWeightedGeneList> biomeSpecificLists) Create a BiomeSpecificWeightedGeneList. -
Method Summary
Modifier and TypeMethodDescriptionallGenes()Get all possible genes in this list.net.minecraft.core.Holder<Gene>getRandomGene(IWeightedGeneList.Context context) Get a random gene from this BiomeSpecificWeightedGeneList.Create a builder for BiomeSpecificWeightedGeneList.stableBuilder(double possibilityOfStable) Create a builder for BiomeSpecificWeightedGeneList.inttotalWeight(IWeightedGeneList.Context context) Get the total weight of this list.
-
Field Details
-
commonList
Common gene list - all biomes share the same gene list. -
biomeSpecificLists
protected final Map<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>,IWeightedGeneList> biomeSpecificListsBiome-specific gene lists - each biome has its own gene list.
-
-
Constructor Details
-
BiomeSpecificWeightedGeneList
protected BiomeSpecificWeightedGeneList(IWeightedGeneList commonList, Map<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>, IWeightedGeneList> biomeSpecificLists) Create a BiomeSpecificWeightedGeneList.- Parameters:
commonList- the common gene listbiomeSpecificLists- the biome-specific gene lists
-
-
Method Details
-
getRandomGene
Get a random gene from this BiomeSpecificWeightedGeneList.- Specified by:
getRandomGenein interfaceIWeightedGeneList- Parameters:
context- the context, where biome is passed.- Returns:
- a random gene
-
totalWeight
Get the total weight of this list.- Specified by:
totalWeightin interfaceIWeightedGeneList- Parameters:
context- the context- Returns:
- the total weight
-
allGenes
Get all possible genes in this list.- Specified by:
allGenesin interfaceIWeightedGeneList- Returns:
- all possible genes
-
simpleBuilder
Create a builder for BiomeSpecificWeightedGeneList. SimpleWeightedGeneList is applied to all biomes.- Returns:
- a builder
-
stableBuilder
Create a builder for BiomeSpecificWeightedGeneList. StableWeightedGeneList is applied to all biomes.- Parameters:
possibilityOfStable- Possibility for stable weighted gene list- Returns:
- a builder
- See Also:
-