Package forestry.api.plugin
Interface IKaryotypeBuilder
public interface IKaryotypeBuilder
Configures the chromosome set (karyotype) of a species type and the default allele for each chromosome.
Validity is permissive: any value of a chromosome's type may appear in a genome, so there is no allele whitelist.
-
Method Summary
Modifier and TypeMethodDescription<V> IChromosomeBuilder<V> get(IChromosome<V> chromosome) Returns the chromosome builder for an already-added chromosome (e.g.default IChromosomeBuilder<Boolean> set(IChromosome<Boolean> chromosome, boolean value) Shortcut for a dominant boolean default.IChromosomeBuilder<net.minecraft.resources.ResourceLocation> set(IChromosome<net.minecraft.resources.ResourceLocation> chromosome, net.minecraft.resources.ResourceLocation defaultId) Adds a reference chromosome (species, flower type, effect, ...) with the given default value ID.<V> IChromosomeBuilder<V> set(IChromosome<V> chromosome, Allele<V> defaultAllele) Adds a data chromosome with the given default allele.voidsetSpecies(IChromosome<net.minecraft.resources.ResourceLocation> species, net.minecraft.resources.ResourceLocation defaultId) Sets the species chromosome of the karyotype.
-
Method Details
-
setSpecies
void setSpecies(IChromosome<net.minecraft.resources.ResourceLocation> species, net.minecraft.resources.ResourceLocation defaultId) Sets the species chromosome of the karyotype.- Parameters:
species- The species (reference) chromosome.defaultId- The ID of the default species, used as a fallback when a genome is unavailable or corrupt.
-
set
Adds a data chromosome with the given default allele. -
set
Shortcut for a dominant boolean default. -
set
IChromosomeBuilder<net.minecraft.resources.ResourceLocation> set(IChromosome<net.minecraft.resources.ResourceLocation> chromosome, net.minecraft.resources.ResourceLocation defaultId) Adds a reference chromosome (species, flower type, effect, ...) with the given default value ID. The value's declared dominance is resolved lazily, after registries are populated. -
get
Returns the chromosome builder for an already-added chromosome (e.g. to set weak inheritance).- Throws:
IllegalArgumentException- If the chromosome has not been added.
-