Interface IWeightedGeneList
- All Known Implementing Classes:
BiomeSpecificWeightedGeneList,SimpleWeightedGeneList,StableWeightedGeneList
public interface IWeightedGeneList
Weighted gene list.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic final recordstatic interface -
Field Summary
Fields -
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 list.inttotalWeight(IWeightedGeneList.Context context) Get the total weight of this list.static intupperBound(it.unimi.dsi.fastutil.ints.IntList a, int value) Binary Search to find the index of the first element in the array that is greater than the given value.
-
Field Details
-
EMPTY
-
-
Method Details
-
getRandomGene
Get a random gene from this list.- Parameters:
context- the context- Returns:
- a random gene
-
totalWeight
Get the total weight of this list.- Parameters:
context- the context- Returns:
- the total weight
-
allGenes
Get all possible genes in this list.- Returns:
- all possible genes
-
upperBound
static int upperBound(it.unimi.dsi.fastutil.ints.IntList a, int value) Binary Search to find the index of the first element in the array that is greater than the given value.- Parameters:
a- The array to searchvalue- The value to search for- Returns:
- The index of the first element in the array that is greater than the given value.
-