Interface IIndividual

All Known Subinterfaces:
IBee, IButterfly, IIndividualLiving, ITree

public interface IIndividual
An individual belongs to a certain species and has a genome and life stage. It can be mated with another individual to produce offspring.
  • Field Details

    • CAPABILITY_ID

      static final net.minecraft.resources.ResourceLocation CAPABILITY_ID
  • Method Details

    • getGenome

      IGenome getGenome()
      Returns:
      The genome of this individual.
    • getType

      ISpeciesType<?,?> getType()
      Returns:
      The species type of this individual.
    • getSpecies

      ISpecies<?> getSpecies()
      Returns:
      The active species of this individual. Prefer this method over getting it from getGenome().
    • getInactiveSpecies

      ISpecies<?> getInactiveSpecies()
      Returns:
      The inactive species of the individual. Prefer this method over getting it from getGenome().
    • setMate

      void setMate(@Nullable IGenome mate)
    • getMate

      @Nullable IGenome getMate()
      Returns:
      The genome of this individual's mate, or null if this individual has no mate.
    • getMateOptional

      Optional<IGenome> getMateOptional()
      An optional getter for getMate(). Used only for Codec purposes, prefer getMate() when possible.
      Returns:
      An optional containing this individual's mate genome, or empty if this individual has no mate.
    • isAnalyzed

      boolean isAnalyzed()
      Returns:
      true if this individual has been analyzed and a summary of its genome should be displayed in its tooltip.
    • analyze

      boolean analyze()
      Returns:
      Sets this species as analyzed. Details about the specimen can be viewed in its tooltip and analyzer pages.
    • createStack

      net.minecraft.world.item.ItemStack createStack(ILifeStage stage)
    • saveToStack

      void saveToStack(net.minecraft.world.item.ItemStack stack)
      Writes the state of this individual, including genome, to an item.
    • hasGlint

      default boolean hasGlint()
    • isSecret

      default boolean isSecret()
    • copy

      IIndividual copy()
      Copies this individual and all of its properties EXCEPT FOR ITS MATE. Override this method in subclasses to make sure all information is copied.
      Returns:
      An exact copy of this individual with NO MATE and NOT ANALYZED.
    • copyWithGenome

      IIndividual copyWithGenome(IGenome newGenome)
      Copies the individual and all of its properties EXCEPT FOR ITS MATE. However, the supplied newGenome is used instead of this individual's genome. Override this method in subclasses to make sure all information is copied.
      Parameters:
      newGenome - The genome to use for the copied individual.
      Returns:
      A copy of this individual with the given genome with NO MATE and NOT ANALYZED.
      Since:
      1.0.4
    • cast

      default <I extends IIndividual> I cast()