Interface IWeightedGeneList

All Known Implementing Classes:
BiomeSpecificWeightedGeneList, SimpleWeightedGeneList, StableWeightedGeneList

public interface IWeightedGeneList
Weighted gene list.
  • Field Details

  • Method Details

    • getRandomGene

      net.minecraft.core.Holder<Gene> getRandomGene(IWeightedGeneList.Context context)
      Get a random gene from this list.
      Parameters:
      context - the context
      Returns:
      a random gene
    • totalWeight

      @Contract(pure=true) int totalWeight(IWeightedGeneList.Context context)
      Get the total weight of this list.
      Parameters:
      context - the context
      Returns:
      the total weight
    • allGenes

      Stream<net.minecraft.core.Holder<Gene>> 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 search
      value - The value to search for
      Returns:
      The index of the first element in the array that is greater than the given value.