Interface IChromosomeCarrier
- All Known Implementing Classes:
LivingEntityMixin,MobEntityMixin,MuleEntityMixin
public interface IChromosomeCarrier
-
Method Summary
Modifier and TypeMethodDescriptionvoidAssign traits to this entity.default List<ChromosomeInstance>chromosomelib$buildDefaultChromosomes(IChromosomeLibEntityType entityType, IWeightedGeneList.Context context) Build default chromosomes of this entity.ToIntFunction<net.minecraft.core.Holder<Gene>>Get active genes of this entity.Collection<net.minecraft.core.Holder<Trait>>Get active traits of this entity.Get all chromosomes of this entity.default intGet ploidy of this entity.booleanCheck if isTraitsSolve flag is true.voidMark isTraitsSolved flag to false.voidchromosomelib$setChromosomes(Collection<ChromosomeInstance> chromosomes) Set chromosomes of this entity.
-
Method Details
-
chromosomelib$getChromosomes
List<ChromosomeInstance> chromosomelib$getChromosomes()Get all chromosomes of this entity.- Returns:
- chromosomes
-
chromosomelib$setChromosomes
Set chromosomes of this entity. At the same time, compute active genes and active traits.- Parameters:
chromosomes- chromosomes
-
chromosomelib$getActiveGenes
ToIntFunction<net.minecraft.core.Holder<Gene>> chromosomelib$getActiveGenes()Get active genes of this entity.- Returns:
- weight of active genes. 0 is for inactive gene, > 0 is for active genes.
-
chromosomelib$getActiveTraits
Collection<net.minecraft.core.Holder<Trait>> chromosomelib$getActiveTraits()Get active traits of this entity.- Returns:
- active traits
-
chromosomelib$assignTraits
void chromosomelib$assignTraits()Assign traits to this entity. -
chromosomelib$buildDefaultChromosomes
@Internal default List<ChromosomeInstance> chromosomelib$buildDefaultChromosomes(IChromosomeLibEntityType entityType, IWeightedGeneList.Context context) Build default chromosomes of this entity.- Parameters:
entityType- entity typecontext- build context- Returns:
- default chromosomes
-
chromosomelib$getPloidy
default int chromosomelib$getPloidy()Get ploidy of this entity. For example, a horse is a diploid entity, so we return 2; a mule is an allodiploid entity (but we consider it is a haploid), so we return 1.- Returns:
- ploidy
-
chromosomelib$resetTraits
void chromosomelib$resetTraits()Mark isTraitsSolved flag to false. -
chromosomelib$isTraitsSolved
boolean chromosomelib$isTraitsSolved()Check if isTraitsSolve flag is true.
-