Package forestry.api.client.genetics
Interface IAnalyzerGraphics<S extends ISpecies<I>,I extends IIndividual>
public interface IAnalyzerGraphics<S extends ISpecies<I>,I extends IIndividual>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIAnalyzerGraphics.IChromosomeRowOptions<C extends IChromosome<A>,A extends IAllele> static interface -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHorizontalSpacing(int x) Adds an empty horizontal space by the specified number of pixels.default voidaddLineSpacing(int lines) voidaddLineSpacing(int lines, boolean compact) Adds an empty vertical space by the specified number of lines.voidaddVerticalSpacing(int y) Adds an empty vertical space by the specified number of pixels.intcenter(net.minecraft.network.chat.Component text) Calculates the x offset needed to center the text.default <C extends IChromosome<A>,A extends IAllele>
voiddrawChromosomeRow(C chromosome) <C extends IChromosome<A>,A extends IAllele>
voiddrawChromosomeRow(C chromosome, @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.voiddrawClimatePreferences(IValueChromosome<ToleranceType> temperatureTolerance, IValueChromosome<ToleranceType> humidityTolerance) Draws temperature preference & tolerance in two rows, then humidity preference and tolerance in two more rows.voiddrawFertilityRow(IIntegerChromosome chromosome, net.minecraft.resources.ResourceLocation offspringSprite) Draws a row displaying information about the fertility chromosome of a specimen.voiddrawMutationsPage(Function<S, net.minecraft.world.item.ItemStack> iconGetter) Draws the built-in Mutations page used in Page 4 of the analyzer.voiddrawProductList(Function<S, List<IProduct>> getProducts) Draws a list of active and inactive products for display in the analyzer graphics interface.voiddrawSpeciesIconsRow(@Nullable Function<S, net.minecraft.world.item.ItemStack> iconGetter) Displays a table of the specimen's chromosomes.voiddrawSplitLine(net.minecraft.network.chat.Component label, net.minecraft.network.chat.Component left, net.minecraft.network.chat.Component right, boolean showRight, @Nullable IAnalyzerGraphics.ISplitLineOptions options) Draws a line in a 3-column table split format.voidDraws the built-in Taxonomy page used in Page 5 of the analyzer.default voiddrawText(net.minecraft.network.chat.Component text) default voiddrawText(net.minecraft.network.chat.Component text, int x) default voiddrawText(net.minecraft.network.chat.Component text, int x, @Nullable InteractableTextOptions options) default voiddrawText(net.minecraft.util.FormattedCharSequence text) default voiddrawText(net.minecraft.util.FormattedCharSequence text, int x) voiddrawText(net.minecraft.util.FormattedCharSequence text, int x, @Nullable InteractableTextOptions options) Draws text at the current coordinates.voiddrawTextWrapped(net.minecraft.network.chat.Component text, @Nullable InteractableTextOptions options) Draws wrapped text.voiddrawTooltip(int x, int y, List<net.minecraft.network.chat.Component> tooltip, List<@Nullable TextOptions> options) Draws a tooltip.default voiddrawTooltip(int x, int y, net.minecraft.network.chat.Component tooltip) default voiddrawTooltip(int x, int y, net.minecraft.network.chat.Component tooltip, @Nullable TextOptions options) net.minecraft.client.gui.Fontfont()voidsetHaploid(boolean haploid) Determines whether the inactive alleles of the current genome should be shown.
-
Method Details
-
drawChromosomeRow
-
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, ornullfor 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 aIClimateSensitivespecies.
-
drawProductList
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 toaddVerticalSpacing(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- Iftrue, 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.nullindicates 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
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.
-