Interface IAllele

All Known Subinterfaces:
IBooleanAllele, IFloatAllele, IIntegerAllele, IRegistryAllele<V>, IValueAllele<V>

public sealed interface IAllele permits IBooleanAllele, IFloatAllele, IIntegerAllele, IValueAllele<V>
Alleles represent named values of a IChromosome in a genome. Create new alleles using IAlleleManager. Alleles are compared by reference equality. Alleles can be created at any time before all species types have been registered. Registered alleles must be usable in the karyotype of at least one species type or an exception will be thrown.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<IAllele>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.resources.ResourceLocation
    Returns the unique ID of this allele.
    default <A extends IAllele>
    A
    Helper method to ignore Java generic type restrictions.
    boolean
     
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<IAllele> CODEC
  • Method Details

    • alleleId

      net.minecraft.resources.ResourceLocation alleleId()
      Returns the unique ID of this allele. All alleles share the same registry, so prefixes like "i" or "tree_" are used to prevent conflicts between different types of alleles. Dominant alleles must be named differently than recessive alleles of the same value. Usually a "d" suffix is good enough.
      Returns:
      Unique ID of this allele.
    • dominant

      boolean dominant()
      Returns:
      true if the allele is dominant, false otherwise.
    • cast

      default <A extends IAllele> A cast()
      Helper method to ignore Java generic type restrictions. Manually casting should be preferred whenever possible, only if absolutely necessary (ex. requires capture of ?)