Class RegistryRelations
java.lang.Object
com.hexagram2021.chromosomelib.registry.RegistryRelations
This class is used to register relations between registries.
Please ONLY call these APIs in main thread to avoid
ConcurrentModificationException!-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidregisterChromosome2GeneLocus(net.minecraft.core.Holder<Chromosome> chromosome, net.minecraft.core.Holder<GeneLocus> geneLocus) Register the chromosome of an entity type.static voidregisterDisableRelation(net.minecraft.core.Holder<Gene> dominant, net.minecraft.core.Holder<Gene> recessive) Dominant genes can render recessive genes ineffective, while many genes in reality are not binary.static voidregisterEntityType2Chromosome(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<Chromosome> chromosome) Register the chromosome of an entity type.static voidregisterEntityType2Chromosome(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<Chromosome> chromosome, int remappedIndex) Register the chromosome of an entity type and remap the index of chromosome.static voidregisterEntityType2TraitType(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<TraitType> traitType) Register the trait of an entity type.static voidregisterEntityTypeTag2Chromosome(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<Chromosome> chromosome) Sometimes some different mobs are the same species (e.g.static voidregisterEntityTypeTag2Chromosome(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<Chromosome> chromosome, int remappedIndex) Sometimes some different mobs are the same species (e.g.static voidregisterEntityTypeTag2TraitType(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<TraitType> traitType) Sometimes some different mobs are the same species (e.g.static voidregisterGeneFrequency(net.minecraft.core.Holder<GeneLocus> geneLocus, IWeightedGeneList.Builder entries) Register the gene frequency of a gene locus.static voidregisterGeneLocus2Gene(net.minecraft.core.Holder<GeneLocus> geneLocus, net.minecraft.core.Holder<Gene> gene) Register the gene locus of a chromosome.static voidregisterNecessaryChromosomeTypes(net.minecraft.core.Holder<Chromosome> chromosome, ChromosomeType chromosomeType) Register a necessary chromosome type of chromosome of a diploid.
-
Method Details
-
registerEntityType2Chromosome
public static void registerEntityType2Chromosome(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<Chromosome> chromosome) Register the chromosome of an entity type.- Parameters:
entityType- the entity typechromosome- the chromosome
-
registerEntityType2Chromosome
public static void registerEntityType2Chromosome(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<Chromosome> chromosome, int remappedIndex) Register the chromosome of an entity type and remap the index of chromosome.- Parameters:
entityType- the entity typechromosome- the chromosomeremappedIndex- the remapped index of the chromosome
-
registerChromosome2GeneLocus
public static void registerChromosome2GeneLocus(net.minecraft.core.Holder<Chromosome> chromosome, net.minecraft.core.Holder<GeneLocus> geneLocus) Register the chromosome of an entity type.- Parameters:
chromosome- the chromosomegeneLocus- the gene locus
-
registerGeneLocus2Gene
public static void registerGeneLocus2Gene(net.minecraft.core.Holder<GeneLocus> geneLocus, net.minecraft.core.Holder<Gene> gene) Register the gene locus of a chromosome.- Parameters:
geneLocus- the gene locusgene- the gene
-
registerEntityType2TraitType
public static void registerEntityType2TraitType(net.minecraft.world.entity.EntityType<?> entityType, net.minecraft.core.Holder<TraitType> traitType) Register the trait of an entity type.- Parameters:
entityType- the entity typetraitType- the trait type
-
registerEntityTypeTag2Chromosome
public static void registerEntityTypeTag2Chromosome(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<Chromosome> chromosome) Sometimes some different mobs are the same species (e.g. Villager, Wandering Trader, Pillager, etc.), so they share same chromosomes.- Parameters:
entityTypeTag- the tag of entity typeschromosome- the chromosome
-
registerEntityTypeTag2Chromosome
public static void registerEntityTypeTag2Chromosome(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<Chromosome> chromosome, int remappedIndex) Sometimes some different mobs are the same species (e.g. Villager, Wandering Trader, Pillager, etc.), so they share same chromosomes.The index of chromosome is also remapped.
- Parameters:
entityTypeTag- the tag of entity typeschromosome- the chromosomeremappedIndex- the remapped index of the chromosome
-
registerEntityTypeTag2TraitType
public static void registerEntityTypeTag2TraitType(net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>> entityTypeTag, net.minecraft.core.Holder<TraitType> traitType) Sometimes some different mobs are the same species (e.g. Villager, Wandering Trader, Pillager, etc.), so they may share same traits.- Parameters:
entityTypeTag- the tag of entity typestraitType- the trait type
-
registerDisableRelation
public static void registerDisableRelation(net.minecraft.core.Holder<Gene> dominant, net.minecraft.core.Holder<Gene> recessive) Dominant genes can render recessive genes ineffective, while many genes in reality are not binary. Please use this function to register all relative explicit implicit relationships. For genes of incomplete dominance, co dominance, and mosaic dominance types, please specify rules inTraitHandler.HANDLERSinstead of this method. Two genes should be (multiple) geneLocusInstances of the same gene locus.- Parameters:
dominant- the dominant generecessive- the recessive gene
-
registerGeneFrequency
public static void registerGeneFrequency(net.minecraft.core.Holder<GeneLocus> geneLocus, IWeightedGeneList.Builder entries) Register the gene frequency of a gene locus.Notice that holders are NOT typed
Holder.Direct. EitherAbstractRegisterEntryorHolder.Referenceis acceptable.- Parameters:
geneLocus- the gene locusentries- genes and their weights
-
registerNecessaryChromosomeTypes
public static void registerNecessaryChromosomeTypes(net.minecraft.core.Holder<Chromosome> chromosome, ChromosomeType chromosomeType) Register a necessary chromosome type of chromosome of a diploid.For example, X is necessary in XX/XY system, while Z is necessary in ZZ/ZW system.
-
freezeAndBuild
@Internal public static void freezeAndBuild()
-