Package forestry.api.genetics.alleles
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 -
Method Summary
-
Field Details
-
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:
trueif the allele is dominant,falseotherwise.
-
cast
Helper method to ignore Java generic type restrictions. Manually casting should be preferred whenever possible, only if absolutely necessary (ex. requires capture of ?)
-