Interface EnchantTooltip
- All Known Implementing Classes:
EnchantTooltip.Apply,EnchantTooltip.Empty,EnchantTooltip.Maxed,EnchantTooltip.MissingSource,EnchantTooltip.Transfer,EnchantTooltip.Upgrade
public sealed interface EnchantTooltip
permits EnchantTooltip.Maxed, EnchantTooltip.Upgrade, EnchantTooltip.Transfer, EnchantTooltip.Apply, EnchantTooltip.MissingSource, EnchantTooltip.Empty
A sealed interface representing a command to render an enchantment tooltip.
Implements the Command Pattern, decoupling the tooltip state evaluation from
the actual GUI rendering logic. Specific implementations (like EnchantTooltip.Upgrade or EnchantTooltip.MissingSource)
encapsulate the data context required to draw text dynamically on the screen.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordTooltip Command: Renders a newly rolled enchantment generated by the enchanting table.static final recordTooltip Command: Empty implementation used as a null object pattern when an invalid or empty widget is hovered.static final recordTooltip Command: Renders standard information for an enchantment that has reached its maximum level.static final recordTooltip Command: Renders an error-state tooltip when the user attempts an upgrade, but the configuredUpgradeSourceTyperules demand a valid source catalyst that is currently absent from the UI.static final recordTooltip Command: Renders information for transferring an enchantment from a source book.static final recordTooltip Command: Renders information for a pending upgrade on the target item, incrementing the displayed level to reflect the projected outcome. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.IdentifierThe resource location referencing the standard galactic alphabet font used for table generation obfuscation. -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawTooltipCost(List<net.minecraft.util.FormattedCharSequence> list, EnchantTooltipContext ctx) Appends standard cost indicators (Lapis and XP level requirements) to the provided formatted sequence list.static ColoringModestatic booleanstatic ColoringModebooleanrender(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY) Executes the tooltip rendering logic.
-
Field Details
-
GALACTIC_FONT_ID
static final net.minecraft.resources.Identifier GALACTIC_FONT_IDThe resource location referencing the standard galactic alphabet font used for table generation obfuscation.
-
-
Method Details
-
render
boolean render(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY) Executes the tooltip rendering logic.- Parameters:
context- The graphics context to render to.mouseX- The current X position of the mouse pointer.mouseY- The current Y position of the mouse pointer.- Returns:
- true if the tooltip was rendered, false if this command is empty.
-
drawTooltipCost
static void drawTooltipCost(List<net.minecraft.util.FormattedCharSequence> list, EnchantTooltipContext ctx) Appends standard cost indicators (Lapis and XP level requirements) to the provided formatted sequence list. Skipped entirely if the player is in creative mode.- Parameters:
list- The target list of formatted sequences to mutate.ctx- The evaluation context holding player state and costs.
-
getThemeColoring
-
getLevelColoring
-
getShowFirstLevel
static boolean getShowFirstLevel()
-