Record Class ClientTooltipFlag

java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.ClientTooltipFlag
All Implemented Interfaces:
net.minecraft.world.item.TooltipFlag

public record ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown) extends Record implements net.minecraft.world.item.TooltipFlag
A version of TooltipFlag that knows about Screen and can provide modifier key states. It is patched into all vanilla uses of TooltipFlags in client classes.

When calling any tooltip method that needs a TooltipFlag yourself, use either this (by calling of(TooltipFlag)) or TooltipFlag.Default depending on the logical side you're on.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.world.item.TooltipFlag

    net.minecraft.world.item.TooltipFlag.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final boolean
    The field for the advanced record component.
    private final boolean
    The field for the altDown record component.
    private final boolean
    The field for the controlDown record component.
    private final boolean
    The field for the creative record component.
    private final boolean
    The field for the shiftDown record component.

    Fields inherited from interface net.minecraft.world.item.TooltipFlag

    ADVANCED, NORMAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown)
    Creates an instance of a ClientTooltipFlag record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the advanced record component.
    boolean
    Returns the value of the altDown record component.
    boolean
    Returns the value of the controlDown record component.
    boolean
    Returns the value of the creative record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
     
    boolean
     
    final int
    Returns a hash code value for this object.
    boolean
     
    boolean
     
    boolean
     
    static net.minecraft.world.item.TooltipFlag
    of(net.minecraft.world.item.TooltipFlag other)
     
    boolean
    Returns the value of the shiftDown 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
  • Field Details

    • advanced

      private final boolean advanced
      The field for the advanced record component.
    • creative

      private final boolean creative
      The field for the creative record component.
    • shiftDown

      private final boolean shiftDown
      The field for the shiftDown record component.
    • controlDown

      private final boolean controlDown
      The field for the controlDown record component.
    • altDown

      private final boolean altDown
      The field for the altDown record component.
  • Constructor Details

    • ClientTooltipFlag

      @Internal public ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown)
      Creates an instance of a ClientTooltipFlag record class.
      Parameters:
      advanced - the value for the advanced record component
      creative - the value for the creative record component
      shiftDown - the value for the shiftDown record component
      controlDown - the value for the controlDown record component
      altDown - the value for the altDown record component
  • Method Details

    • isAdvanced

      public boolean isAdvanced()
      Specified by:
      isAdvanced in interface net.minecraft.world.item.TooltipFlag
    • isCreative

      public boolean isCreative()
      Specified by:
      isCreative in interface net.minecraft.world.item.TooltipFlag
    • hasControlDown

      public boolean hasControlDown()
      Specified by:
      hasControlDown in interface net.minecraft.world.item.TooltipFlag
    • hasShiftDown

      public boolean hasShiftDown()
      Specified by:
      hasShiftDown in interface net.minecraft.world.item.TooltipFlag
    • hasAltDown

      public boolean hasAltDown()
      Specified by:
      hasAltDown in interface net.minecraft.world.item.TooltipFlag
    • of

      public static net.minecraft.world.item.TooltipFlag of(net.minecraft.world.item.TooltipFlag other)
    • 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. All components in this record class 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.
    • advanced

      public boolean advanced()
      Returns the value of the advanced record component.
      Returns:
      the value of the advanced record component
    • creative

      public boolean creative()
      Returns the value of the creative record component.
      Returns:
      the value of the creative record component
    • shiftDown

      public boolean shiftDown()
      Returns the value of the shiftDown record component.
      Returns:
      the value of the shiftDown record component
    • controlDown

      public boolean controlDown()
      Returns the value of the controlDown record component.
      Returns:
      the value of the controlDown record component
    • altDown

      public boolean altDown()
      Returns the value of the altDown record component.
      Returns:
      the value of the altDown record component