Interface IAnalyzerGraphics<S extends ISpecies<I>,I extends IIndividual>


public interface IAnalyzerGraphics<S extends ISpecies<I>,I extends IIndividual>
  • Method Details

    • drawChromosomeRow

      default <C extends IChromosome<A>, A extends IAllele> void drawChromosomeRow(C chromosome)
    • drawChromosomeRow

      <C extends IChromosome<A>, A extends IAllele> void drawChromosomeRow(C chromosome, @Nullable @Nullable IAnalyzerGraphics.IChromosomeRowOptions<C,A> options)
      Draws a row starting with the name of the chromosome, then the active allele followed by the inactive allele.
      Parameters:
      chromosome - The chromosome to display.
      options - Further configuration of how the row is drawn and/or interacted with.
    • drawSpeciesIconsRow

      void drawSpeciesIconsRow(@Nullable @Nullable Function<S,net.minecraft.world.item.ItemStack> iconGetter)
      Displays a table of the specimen's chromosomes. Automatically adds a species header with or without species icons. Supports haploid display as well, in which case the inactive column is omitted.
      Parameters:
      iconGetter - The function used to map species to item-s icons for the active/inactive species, or null for no icons.
    • drawFertilityRow

      void drawFertilityRow(IIntegerChromosome chromosome, net.minecraft.resources.ResourceLocation offspringSprite)
      Draws a row displaying information about the fertility chromosome of a specimen. It includes visual elements for the active allele value and an offspring sprite.
      Parameters:
      chromosome - The fertility chromosome to display, containing alleles representing fertility values.
      offspringSprite - The visual representation of the offspring associated with the chromosome.
    • drawClimatePreferences

      void drawClimatePreferences(IValueChromosome<ToleranceType> temperatureTolerance, IValueChromosome<ToleranceType> humidityTolerance)
      Draws temperature preference & tolerance in two rows, then humidity preference and tolerance in two more rows.
      Parameters:
      temperatureTolerance - The chromosome to use for temperature tolerance.
      humidityTolerance - The chromosome to use for humidity tolerance.
      Throws:
      IllegalArgumentException - If the table's genome is not for a IClimateSensitive species.
    • drawProductList

      void drawProductList(Function<S,List<IProduct>> getProducts)
      Draws a list of active and inactive products for display in the analyzer graphics interface. Products that appear in both the active and inactive are not shown twice.
      Parameters:
      getProducts - Returns a list of products based on the species.
    • drawText

      default void drawText(net.minecraft.network.chat.Component text)
    • drawText

      default void drawText(net.minecraft.network.chat.Component text, int x)
    • drawText

      default void drawText(net.minecraft.network.chat.Component text, int x, @Nullable @Nullable InteractableTextOptions options)
    • drawText

      default void drawText(net.minecraft.util.FormattedCharSequence text)
    • drawText

      default void drawText(net.minecraft.util.FormattedCharSequence text, int x)
    • drawText

      void drawText(net.minecraft.util.FormattedCharSequence text, int x, @Nullable @Nullable InteractableTextOptions options)
      Draws text at the current coordinates.
      Parameters:
      text - The text.
      x - The number of pixels to horizontally offset by.
      options - Options specifying styling (color, bold/italic/underline, drop shadow) and hover behavior.
    • drawTextWrapped

      void drawTextWrapped(net.minecraft.network.chat.Component text, @Nullable @Nullable InteractableTextOptions options)
      Draws wrapped text. Currently, does not support x offset.
      Parameters:
      text - The text to draw, which will be split across multiple lines if longer than 200 pixels.
      options - Options specifying styling.
    • drawSplitLine

      void drawSplitLine(net.minecraft.network.chat.Component label, net.minecraft.network.chat.Component left, net.minecraft.network.chat.Component right, boolean showRight, @Nullable @Nullable IAnalyzerGraphics.ISplitLineOptions options)
      Draws a line in a 3-column table split format. Used in the analyzer to control individual styling/behavior for active/inactive alleles.
      Parameters:
      label - The label for the row to display on the left side.
      left - The text to display in the middle.
      right - The text to display on the right.
      showRight - Whether the right text should be rendered. Used by haploid mode to hide the unused set of alleles.
      options - Controls styling and interaction behavior for the left and right text.
    • addHorizontalSpacing

      void addHorizontalSpacing(int x)
      Adds an empty horizontal space by the specified number of pixels.
      Parameters:
      x - The number of pixels to add as spacing.
    • addVerticalSpacing

      void addVerticalSpacing(int y)
      Adds an empty vertical space by the specified number of pixels.
      Parameters:
      y - The number of pixels to add as spacing.
    • addLineSpacing

      default void addLineSpacing(int lines)
    • addLineSpacing

      void addLineSpacing(int lines, boolean compact)
      Adds an empty vertical space by the specified number of lines. Similar to addVerticalSpacing(int), but uses font lines as a unit instead of pixels.
      Parameters:
      lines - The number of lines to shift down by. Line height is usually 12 pixels.
      compact - If the next line should appear closer to the previous line. Used to cram many lines, like for the Taxonomy page.
    • setHaploid

      void setHaploid(boolean haploid)
      Determines whether the inactive alleles of the current genome should be shown.
      Parameters:
      haploid - If true, only the active alleles are shown.
    • drawTooltip

      default void drawTooltip(int x, int y, net.minecraft.network.chat.Component tooltip)
    • drawTooltip

      default void drawTooltip(int x, int y, net.minecraft.network.chat.Component tooltip, @Nullable @Nullable TextOptions options)
    • drawTooltip

      void drawTooltip(int x, int y, List<net.minecraft.network.chat.Component> tooltip, List<@Nullable TextOptions> options)
      Draws a tooltip.
      Parameters:
      x - The cursor X position to draw the tooltip at.
      y - The cursor Y position to draw the tooltip at.
      tooltip - The list of tooltip lines to draw.
      options - Text styling options. Each element corresponds to styling for the line at the same index in tooltip. null indicates no styling.
    • center

      int center(net.minecraft.network.chat.Component text)
      Calculates the x offset needed to center the text.
      Parameters:
      text - The input text.
      Returns:
      The x offset to add to the text coordinates to horizontally center it.
    • font

      net.minecraft.client.gui.Font font()
    • drawMutationsPage

      void drawMutationsPage(Function<S,net.minecraft.world.item.ItemStack> iconGetter)
      Draws the built-in Mutations page used in Page 4 of the analyzer.
      Parameters:
      iconGetter - The function used to retrieve item stacks to display each mutation icon.
    • drawTaxonomyPage

      void drawTaxonomyPage()
      Draws the built-in Taxonomy page used in Page 5 of the analyzer.