Interface IGeneticRegistration


public interface IGeneticRegistration
Handles registration of genetic-related data. Accessed from IForestryPlugin.registerGenetics(IGeneticRegistration).
  • Method Details

    • defineTaxon

      void defineTaxon(String parent, String name)
      Defines a new taxon under an existing parent. Taxa are displayed as classifications in the Forestry analyzer. When defining a new tree of taxa, it is better to use defineTaxon(String, String, Consumer) instead of making repeated calls to this method.
      Parameters:
      parent - The name of the parent taxon. Cannot be a TaxonomicRank.GENUS.
      name - The name of the taxon. Must be unique.
      Throws:
      UnsupportedOperationException - If the parent taxon is a GENUS.
      See Also:
    • defineTaxon

      void defineTaxon(String parent, String name, Consumer<ITaxonBuilder> action)
      Defines a new taxon or retrieves an existing taxon, allows for adding subtaxa and species.
      Parameters:
      parent - The name of the parent taxon. Cannot be a TaxonomicRank.GENUS.
      name - The name of the taxon. Must be unique for all taxa in the same rank.
      action - A consumer that adds additional information to the taxon after it is defined.
      Throws:
      UnsupportedOperationException - If the parent taxon is a GENUS.
      See Also:
    • registerSpeciesType

      ISpeciesTypeBuilder registerSpeciesType(net.minecraft.resources.ResourceLocation id, ISpeciesTypeFactory typeFactory)
      Register a new type of species. Can only be called from IForestryPlugin.registerGenetics(forestry.api.plugin.IGeneticRegistration).
      Parameters:
      id - The ID of the species.
      typeFactory - The function to use to create the species type, given the completed karyotype.
      Returns:
      A builder that can be used to define properties of the species.
    • modifySpeciesType

      void modifySpeciesType(net.minecraft.resources.ResourceLocation id, Consumer<ISpeciesTypeBuilder> action)
      Modify an existing species, for example, adding an extra chromosome to bees, or adding additional permitted alleles to chromosomes. Called after all species types are registered, but before the registry is finalized.
      Parameters:
      id - The ID of the species to modify.
      action - The modifications to be made.
    • registerFilterRuleType

      void registerFilterRuleType(IFilterRuleType ruleType)
      Registers a new filter rule for the Genetic Filter block.
      Parameters:
      ruleType - The filter rule type to register.
    • registerFilterRuleTypes

      default void registerFilterRuleTypes(IFilterRuleType[] ruleTypes)