Record Class EnchantTooltip.Apply
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.client.gui.tooltip.enchant.EnchantTooltip.Apply
- Record Components:
ctx- The tooltip context containing state data.
- All Implemented Interfaces:
EnchantTooltip
- Enclosing interface:
EnchantTooltip
public static record EnchantTooltip.Apply(EnchantTooltipContext ctx)
extends Record
implements EnchantTooltip
Tooltip Command: Renders a newly rolled enchantment generated by the enchanting table.
Optionally obfuscates the text and descriptions using the standard galactic alphabet
until hovered or decoded. Evaluates theme colors dynamically.
-
Nested Class Summary
Nested classes/interfaces inherited from interface johnsmith.enchantingoverhauled.client.gui.tooltip.enchant.EnchantTooltip
EnchantTooltip.Apply, EnchantTooltip.Empty, EnchantTooltip.Maxed, EnchantTooltip.MissingSource, EnchantTooltip.Transfer, EnchantTooltip.Upgrade -
Field Summary
Fields inherited from interface johnsmith.enchantingoverhauled.client.gui.tooltip.enchant.EnchantTooltip
GALACTIC_FONT_ID -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aApplyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionctx()Returns the value of thectxrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanrender(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY) Executes the tooltip rendering logic.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Apply
Creates an instance of aApplyrecord class.- Parameters:
ctx- the value for thectxrecord component
-
-
Method Details
-
render
public boolean render(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY) Description copied from interface:EnchantTooltipExecutes the tooltip rendering logic.- Specified by:
renderin interfaceEnchantTooltip- 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.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
ctx
Returns the value of thectxrecord component.- Returns:
- the value of the
ctxrecord component
-