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

    Constructors
    Constructor
    Description
    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 a EnchantTooltipContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the cost record component.
    net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment>
    Returns the value of the enchantment record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.client.gui.Font
    Returns the value of the font record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isCreative record component.
    int
    Returns the value of the lapisCount record component.
    int
    Returns the value of the level record component.
    net.minecraft.client.Minecraft
    Returns the value of the minecraft record component.
    int
    Returns the value of the powerRequirement record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a EnchantTooltipContext record class.
      Parameters:
      font - the value for the font record component
      lapisCount - the value for the lapisCount record component
      isCreative - the value for the isCreative record component
      enchantment - the value for the enchantment record component
      level - the value for the level record component
      powerRequirement - the value for the powerRequirement record component
      cost - the value for the cost record component
      minecraft - the value for the minecraft record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • font

      public net.minecraft.client.gui.Font font()
      Returns the value of the font record component.
      Returns:
      the value of the font record component
    • lapisCount

      public int lapisCount()
      Returns the value of the lapisCount record component.
      Returns:
      the value of the lapisCount record component
    • isCreative

      public boolean isCreative()
      Returns the value of the isCreative record component.
      Returns:
      the value of the isCreative record component
    • enchantment

      public net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment()
      Returns the value of the enchantment record component.
      Returns:
      the value of the enchantment record component
    • level

      public int level()
      Returns the value of the level record component.
      Returns:
      the value of the level record component
    • powerRequirement

      public int powerRequirement()
      Returns the value of the powerRequirement record component.
      Returns:
      the value of the powerRequirement record component
    • cost

      public int cost()
      Returns the value of the cost record component.
      Returns:
      the value of the cost record component
    • minecraft

      public net.minecraft.client.Minecraft minecraft()
      Returns the value of the minecraft record component.
      Returns:
      the value of the minecraft record component