Interface IAlleleManager


public interface IAlleleManager
Used to retrieve interned instances of alleles. Also exposes methods for creating chromosomes. Store alleles obtained from these method calls in a static class like Forestry does in ForestryAlleles. This class is not thread-safe.
See Also:
  • Method Details

    • intAllele

      default IIntegerAllele intAllele(int value)
      Returns:
      A recessive integer allele with the given value.
    • intAllele

      IIntegerAllele intAllele(int value, boolean dominant)
      Creates a new allele for the given value, or retrieves a pre-existing allele if one has already been made.
      Parameters:
      value - The value of this allele.
      dominant - If this allele is dominant.
      Returns:
      A new allele, or an existing one if this allele has already been created elsewhere.
    • floatAllele

      default IFloatAllele floatAllele(float value)
    • floatAllele

      IFloatAllele floatAllele(float value, boolean dominant)
    • valueAllele

      default <V> IValueAllele<V> valueAllele(V value, IAlleleNaming<V> naming)
    • valueAllele

      <V> IValueAllele<V> valueAllele(V value, boolean dominant, IAlleleNaming<V> naming)
    • booleanAllele

      IBooleanAllele booleanAllele(boolean value, boolean dominant)
      Returns:
      A new boolean allele.
    • registryAllele

      <V extends IRegistryAlleleValue> IRegistryAllele<V> registryAllele(net.minecraft.resources.ResourceLocation id, IRegistryChromosome<V> chromosome)
    • alleleCodec

      com.mojang.serialization.Codec<IAllele> alleleCodec()
      Returns:
      The allele codec, which serializes/deserializes using the allele's ID.
    • chromosomeCodec

      com.mojang.serialization.Codec<IChromosome<?>> chromosomeCodec()
      Returns:
      The chromosome codec, which serializes/deserializes using the chromosome's ID.
    • getAllele

      @Nullable IAllele getAllele(net.minecraft.resources.ResourceLocation id)
      Returns:
      An allele with the given ID, or null if no allele has been created with that ID.
    • floatChromosome

      IFloatChromosome floatChromosome(net.minecraft.resources.ResourceLocation id)
    • intChromosome

      IIntegerChromosome intChromosome(net.minecraft.resources.ResourceLocation id)
    • booleanChromosome

      IBooleanChromosome booleanChromosome(net.minecraft.resources.ResourceLocation id)
    • valueChromosome

      <V> IValueChromosome<V> valueChromosome(net.minecraft.resources.ResourceLocation id, Class<V> valueClass)
    • registryChromosome

      <V extends IRegistryAlleleValue> IRegistryChromosome<V> registryChromosome(net.minecraft.resources.ResourceLocation id, Class<V> valueClass)
      Creates and registers a registry chromosome, which is responsible for populating the values of its corresponding IRegistryAllele instances.
      Type Parameters:
      V - The type of value contained by the alleles of this chromosome.
      Parameters:
      id - The ID of this chromosome.
      valueClass - The type of value this chromosome's alleles hold. Must implement IRegistryAlleleValue.
      Returns:
      A new registry chromosome.
    • getChromosome

      @Nullable IChromosome<?> getChromosome(net.minecraft.resources.ResourceLocation id)
      Returns:
      A chromosome with the given ID, or null if no chromosome has been created with that ID.
      Since:
      2.1.1