Package net.neoforged.neoforge.client
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
FieldsModifier and TypeFieldDescriptionprivate final boolean
The field for theadvanced
record component.private final boolean
The field for thealtDown
record component.private final boolean
The field for thecontrolDown
record component.private final boolean
The field for thecreative
record component.private final boolean
The field for theshiftDown
record component.Fields inherited from interface net.minecraft.world.item.TooltipFlag
ADVANCED, NORMAL
-
Constructor Summary
ConstructorsConstructorDescriptionClientTooltipFlag
(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown) Creates an instance of aClientTooltipFlag
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
advanced()
Returns the value of theadvanced
record component.boolean
altDown()
Returns the value of thealtDown
record component.boolean
Returns the value of thecontrolDown
record component.boolean
creative()
Returns the value of thecreative
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
boolean
final int
hashCode()
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 theshiftDown
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
advanced
private final boolean advancedThe field for theadvanced
record component. -
creative
private final boolean creativeThe field for thecreative
record component. -
shiftDown
private final boolean shiftDownThe field for theshiftDown
record component. -
controlDown
private final boolean controlDownThe field for thecontrolDown
record component. -
altDown
private final boolean altDownThe field for thealtDown
record component.
-
-
Constructor Details
-
ClientTooltipFlag
@Internal public ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown) Creates an instance of aClientTooltipFlag
record class.- Parameters:
advanced
- the value for theadvanced
record componentcreative
- the value for thecreative
record componentshiftDown
- the value for theshiftDown
record componentcontrolDown
- the value for thecontrolDown
record componentaltDown
- the value for thealtDown
record component
-
-
Method Details
-
isAdvanced
public boolean isAdvanced()- Specified by:
isAdvanced
in interfacenet.minecraft.world.item.TooltipFlag
-
isCreative
public boolean isCreative()- Specified by:
isCreative
in interfacenet.minecraft.world.item.TooltipFlag
-
hasControlDown
public boolean hasControlDown()- Specified by:
hasControlDown
in interfacenet.minecraft.world.item.TooltipFlag
-
hasShiftDown
public boolean hasShiftDown()- Specified by:
hasShiftDown
in interfacenet.minecraft.world.item.TooltipFlag
-
hasAltDown
public boolean hasAltDown()- Specified by:
hasAltDown
in interfacenet.minecraft.world.item.TooltipFlag
-
of
public static net.minecraft.world.item.TooltipFlag of(net.minecraft.world.item.TooltipFlag other) -
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 with '=='. -
advanced
public boolean advanced()Returns the value of theadvanced
record component.- Returns:
- the value of the
advanced
record component
-
creative
public boolean creative()Returns the value of thecreative
record component.- Returns:
- the value of the
creative
record component
-
shiftDown
public boolean shiftDown()Returns the value of theshiftDown
record component.- Returns:
- the value of the
shiftDown
record component
-
controlDown
public boolean controlDown()Returns the value of thecontrolDown
record component.- Returns:
- the value of the
controlDown
record component
-
altDown
public boolean altDown()Returns the value of thealtDown
record component.- Returns:
- the value of the
altDown
record component
-