Record Class TooltipDisplay
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.TooltipDisplay
public record TooltipDisplay(boolean hideTooltip, SequencedSet<DataComponentType<?>> hiddenComponents)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<TooltipDisplay> private static final com.mojang.serialization.Codec
<SequencedSet<DataComponentType<?>>> static final TooltipDisplay
private final SequencedSet
<DataComponentType<?>> The field for thehiddenComponents
record component.private final boolean
The field for thehideTooltip
record component.static final StreamCodec
<RegistryFriendlyByteBuf, TooltipDisplay> -
Constructor Summary
ConstructorsConstructorDescriptionTooltipDisplay
(boolean hideTooltip, SequencedSet<DataComponentType<?>> hiddenComponents) Creates an instance of aTooltipDisplay
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thehiddenComponents
record component.boolean
Returns the value of thehideTooltip
record component.boolean
shows
(DataComponentType<?> p_399593_) final String
toString()
Returns a string representation of this record class.withHidden
(DataComponentType<?> p_400224_, boolean p_400307_)
-
Field Details
-
hideTooltip
private final boolean hideTooltipThe field for thehideTooltip
record component. -
COMPONENT_SET_CODEC
private static final com.mojang.serialization.Codec<SequencedSet<DataComponentType<?>>> COMPONENT_SET_CODEC -
CODEC
-
STREAM_CODEC
-
DEFAULT
-
-
Constructor Details
-
TooltipDisplay
Creates an instance of aTooltipDisplay
record class.- Parameters:
hideTooltip
- the value for thehideTooltip
record componenthiddenComponents
- the value for thehiddenComponents
record component
-
-
Method Details
-
withHidden
-
shows
-
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 '=='. -
hideTooltip
public boolean hideTooltip()Returns the value of thehideTooltip
record component.- Returns:
- the value of the
hideTooltip
record component
-