Record Class EnchantTooltipContext
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.client.gui.tooltip.enchant.EnchantTooltipContext
- Record Components:
font- The client's active font renderer.lapisCount- The amount of Lapis Lazuli currently available in the fuel slot.isCreative- True if the current player is in creative mode, skipping resource costs.enchantment- The specific enchantment being evaluated for display.level- The resolved display level (either the target's current level, or the incoming pending level).powerRequirement- The total enchanting power (bookshelves) required to unlock this slot.cost- The base experience level and lapis cost to execute the action.minecraft- The active Minecraft client instance for accessing world registry references.
public record EnchantTooltipContext(net.minecraft.client.gui.Font font, int lapisCount, boolean isCreative, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int level, int powerRequirement, int cost, net.minecraft.client.Minecraft minecraft)
extends Record
A data record encapsulating all state dependencies required to build and render
an
EnchantTooltip command successfully.-
Constructor Summary
ConstructorsConstructorDescriptionEnchantTooltipContext(net.minecraft.client.gui.Font font, int lapisCount, boolean isCreative, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int level, int powerRequirement, int cost, net.minecraft.client.Minecraft minecraft) Creates an instance of aEnchantTooltipContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcost()Returns the value of thecostrecord component.net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> Returns the value of theenchantmentrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.client.gui.Fontfont()Returns the value of thefontrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisCreativerecord component.intReturns the value of thelapisCountrecord component.intlevel()Returns the value of thelevelrecord component.net.minecraft.client.MinecraftReturns the value of theminecraftrecord component.intReturns the value of thepowerRequirementrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EnchantTooltipContext
public EnchantTooltipContext(net.minecraft.client.gui.Font font, int lapisCount, boolean isCreative, net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, int level, int powerRequirement, int cost, net.minecraft.client.Minecraft minecraft) Creates an instance of aEnchantTooltipContextrecord class.- Parameters:
font- the value for thefontrecord componentlapisCount- the value for thelapisCountrecord componentisCreative- the value for theisCreativerecord componentenchantment- the value for theenchantmentrecord componentlevel- the value for thelevelrecord componentpowerRequirement- the value for thepowerRequirementrecord componentcost- the value for thecostrecord componentminecraft- the value for theminecraftrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
font
public net.minecraft.client.gui.Font font()Returns the value of thefontrecord component.- Returns:
- the value of the
fontrecord component
-
lapisCount
public int lapisCount()Returns the value of thelapisCountrecord component.- Returns:
- the value of the
lapisCountrecord component
-
isCreative
public boolean isCreative()Returns the value of theisCreativerecord component.- Returns:
- the value of the
isCreativerecord component
-
enchantment
public net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment()Returns the value of theenchantmentrecord component.- Returns:
- the value of the
enchantmentrecord component
-
level
public int level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
powerRequirement
public int powerRequirement()Returns the value of thepowerRequirementrecord component.- Returns:
- the value of the
powerRequirementrecord component
-
cost
public int cost()Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
minecraft
public net.minecraft.client.Minecraft minecraft()Returns the value of theminecraftrecord component.- Returns:
- the value of the
minecraftrecord component
-