Class FabricPlatformHelper
java.lang.Object
com.hexagram2021.chromosomelib.fabric.FabricPlatformHelper
- All Implemented Interfaces:
AfterAssigningTraitSolver,UnpairedChromosomesToBreedSolver,IPlatformHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionregisterChromosome(net.minecraft.resources.ResourceLocation id, Supplier<Chromosome> chromosome) registerGene(net.minecraft.resources.ResourceLocation id, Supplier<Gene> gene) registerGeneLocus(net.minecraft.resources.ResourceLocation id, Supplier<GeneLocus> geneLocus) registerTrait(net.minecraft.resources.ResourceLocation id, Supplier<Trait> trait) registerTraitType(net.minecraft.resources.ResourceLocation id, Supplier<TraitType> traitType) voidsolveAfterAssigningTrait(net.minecraft.world.entity.LivingEntity livingEntity, Map<net.minecraft.core.Holder<TraitType>, net.minecraft.core.Holder<Trait>> map, Predicate<net.minecraft.core.Holder<Trait>> hasTrait) booleansolveUnpairedChromosomesToBreed(net.minecraft.world.entity.EntityType<?> entityType, Collection<ChromosomeInstance> chromosomeInstances, net.minecraft.util.RandomSource random, com.google.common.collect.ImmutableCollection.Builder<ChromosomeInstance> builder)
-
Constructor Details
-
FabricPlatformHelper
public FabricPlatformHelper()
-
-
Method Details
-
registerChromosome
public AbstractRegisterEntry<Chromosome> registerChromosome(net.minecraft.resources.ResourceLocation id, Supplier<Chromosome> chromosome) - Specified by:
registerChromosomein interfaceIPlatformHelper
-
registerGeneLocus
public AbstractRegisterEntry<GeneLocus> registerGeneLocus(net.minecraft.resources.ResourceLocation id, Supplier<GeneLocus> geneLocus) - Specified by:
registerGeneLocusin interfaceIPlatformHelper
-
registerGene
public AbstractRegisterEntry<Gene> registerGene(net.minecraft.resources.ResourceLocation id, Supplier<Gene> gene) - Specified by:
registerGenein interfaceIPlatformHelper
-
registerTrait
public AbstractRegisterEntry<Trait> registerTrait(net.minecraft.resources.ResourceLocation id, Supplier<Trait> trait) - Specified by:
registerTraitin interfaceIPlatformHelper
-
registerTraitType
public AbstractRegisterEntry<TraitType> registerTraitType(net.minecraft.resources.ResourceLocation id, Supplier<TraitType> traitType) - Specified by:
registerTraitTypein interfaceIPlatformHelper
-
solveUnpairedChromosomesToBreed
public boolean solveUnpairedChromosomesToBreed(net.minecraft.world.entity.EntityType<?> entityType, Collection<ChromosomeInstance> chromosomeInstances, net.minecraft.util.RandomSource random, com.google.common.collect.ImmutableCollection.Builder<ChromosomeInstance> builder) - Specified by:
solveUnpairedChromosomesToBreedin interfaceIPlatformHelper- Specified by:
solveUnpairedChromosomesToBreedin interfaceUnpairedChromosomesToBreedSolver- Parameters:
entityType- the entity type with unpaired chromosomeschromosomeInstances- the chromosome instances of this entityrandom- random sourcebuilder- chromosomes builder, do NOT modify it until you decide to returntrue- Returns:
trueif we just solved this situation.falseotherwise. If false, the builder should NOT be modified.
-
solveAfterAssigningTrait
public void solveAfterAssigningTrait(net.minecraft.world.entity.LivingEntity livingEntity, Map<net.minecraft.core.Holder<TraitType>, net.minecraft.core.Holder<Trait>> map, Predicate<net.minecraft.core.Holder<Trait>> hasTrait) - Specified by:
solveAfterAssigningTraitin interfaceAfterAssigningTraitSolver- Specified by:
solveAfterAssigningTraitin interfaceIPlatformHelper- Parameters:
livingEntity- the living entitymap- the trait maphasTrait- whether the living entity has the trait
-