Package net.neoforged.neoforge.client
Record Class ClientTooltipFlag
java.lang.Object
java.lang.Record
net.neoforged.neoforge.client.ClientTooltipFlag
- All Implemented Interfaces:
TooltipFlag
public record ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown)
extends Record
implements 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
TooltipFlag.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theadvancedrecord component.private final booleanThe field for thealtDownrecord component.private final booleanThe field for thecontrolDownrecord component.private final booleanThe field for thecreativerecord component.private final booleanThe field for theshiftDownrecord 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 aClientTooltipFlagrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadvanced()Returns the value of theadvancedrecord component.booleanaltDown()Returns the value of thealtDownrecord component.booleanReturns the value of thecontrolDownrecord component.booleancreative()Returns the value of thecreativerecord component.final booleanIndicates whether some other object is "equal to" this one.booleanNeo: Returns the state of the Alt key (as reported by Screen) on the client, orfalseon the server.booleanNeo: Returns the state of the Control key (as reported by Screen) on the client, orfalseon the server.final inthashCode()Returns a hash code value for this object.booleanNeo: Returns the state of the Shift key (as reported by Screen) on the client, orfalseon the server.booleanbooleanstatic TooltipFlagof(TooltipFlag other) booleanReturns the value of theshiftDownrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
advanced
private final boolean advancedThe field for theadvancedrecord component. -
creative
private final boolean creativeThe field for thecreativerecord component. -
shiftDown
private final boolean shiftDownThe field for theshiftDownrecord component. -
controlDown
private final boolean controlDownThe field for thecontrolDownrecord component. -
altDown
private final boolean altDownThe field for thealtDownrecord component.
-
-
Constructor Details
-
ClientTooltipFlag
@Internal public ClientTooltipFlag(boolean advanced, boolean creative, boolean shiftDown, boolean controlDown, boolean altDown) Creates an instance of aClientTooltipFlagrecord class.- Parameters:
advanced- the value for theadvancedrecord componentcreative- the value for thecreativerecord componentshiftDown- the value for theshiftDownrecord componentcontrolDown- the value for thecontrolDownrecord componentaltDown- the value for thealtDownrecord component
-
-
Method Details
-
isAdvanced
public boolean isAdvanced()- Specified by:
isAdvancedin interfaceTooltipFlag
-
isCreative
public boolean isCreative()- Specified by:
isCreativein interfaceTooltipFlag
-
hasControlDown
public boolean hasControlDown()Description copied from interface:TooltipFlagNeo: Returns the state of the Control key (as reported by Screen) on the client, orfalseon the server.- Specified by:
hasControlDownin interfaceTooltipFlag
-
hasShiftDown
public boolean hasShiftDown()Description copied from interface:TooltipFlagNeo: Returns the state of the Shift key (as reported by Screen) on the client, orfalseon the server.- Specified by:
hasShiftDownin interfaceTooltipFlag
-
hasAltDown
public boolean hasAltDown()Description copied from interface:TooltipFlagNeo: Returns the state of the Alt key (as reported by Screen) on the client, orfalseon the server.- Specified by:
hasAltDownin interfaceTooltipFlag
-
of
-
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 theadvancedrecord component.- Returns:
- the value of the
advancedrecord component
-
creative
public boolean creative()Returns the value of thecreativerecord component.- Returns:
- the value of the
creativerecord component
-
shiftDown
public boolean shiftDown()Returns the value of theshiftDownrecord component.- Returns:
- the value of the
shiftDownrecord component
-
controlDown
public boolean controlDown()Returns the value of thecontrolDownrecord component.- Returns:
- the value of the
controlDownrecord component
-
altDown
public boolean altDown()Returns the value of thealtDownrecord component.- Returns:
- the value of the
altDownrecord component
-