Record Class AdvancementsPacket.DisplayData
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.AdvancementsPacket.DisplayData
- All Implemented Interfaces:
ComponentHolder<AdvancementsPacket.DisplayData>
,NetworkBuffer.Writer
- Enclosing class:
AdvancementsPacket
public static record AdvancementsPacket.DisplayData(@NotNull Component title, @NotNull Component description, @NotNull ItemStack icon, @NotNull FrameType frameType, int flags, @Nullable String backgroundTexture, float x, float y)
extends Record
implements NetworkBuffer.Writer, ComponentHolder<AdvancementsPacket.DisplayData>
-
Constructor Summary
ConstructorDescriptionDisplayData
(@NotNull Component title, @NotNull Component description, @NotNull ItemStack icon, @NotNull FrameType frameType, int flags, @Nullable String backgroundTexture, float x, float y) Creates an instance of aDisplayData
record class.DisplayData
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Returns the value of thebackgroundTexture
record component.@NotNull Collection
<Component> Gets the components held by this object.@NotNull AdvancementsPacket.DisplayData
copyWithOperator
(@NotNull UnaryOperator<Component> operator) Returns a copy of this object.@NotNull Component
Returns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.int
flags()
Returns the value of theflags
record component.@NotNull FrameType
Returns the value of theframeType
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull ItemStack
icon()
Returns the value of theicon
record component.@NotNull Component
title()
Returns the value of thetitle
record component.final String
toString()
Returns a string representation of this record class.void
write
(@NotNull NetworkBuffer writer) float
x()
Returns the value of thex
record component.float
y()
Returns the value of they
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minestom.server.adventure.ComponentHolder
visitComponents
-
Constructor Details
-
DisplayData
-
DisplayData
public DisplayData(@NotNull @NotNull Component title, @NotNull @NotNull Component description, @NotNull @NotNull ItemStack icon, @NotNull @NotNull FrameType frameType, int flags, @Nullable @Nullable String backgroundTexture, float x, float y) Creates an instance of aDisplayData
record class.- Parameters:
title
- the value for thetitle
record componentdescription
- the value for thedescription
record componenticon
- the value for theicon
record componentframeType
- the value for theframeType
record componentflags
- the value for theflags
record componentbackgroundTexture
- the value for thebackgroundTexture
record componentx
- the value for thex
record componenty
- the value for they
record component
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
components
Description copied from interface:ComponentHolder
Gets the components held by this object.- Specified by:
components
in interfaceComponentHolder<AdvancementsPacket.DisplayData>
- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull AdvancementsPacket.DisplayData copyWithOperator(@NotNull @NotNull UnaryOperator<Component> operator) Description copied from interface:ComponentHolder
Returns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperator
in interfaceComponentHolder<AdvancementsPacket.DisplayData>
- Parameters:
operator
- the operator- Returns:
- the copy
-
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 '=='. -
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
icon
Returns the value of theicon
record component.- Returns:
- the value of the
icon
record component
-
frameType
Returns the value of theframeType
record component.- Returns:
- the value of the
frameType
record component
-
flags
public int flags()Returns the value of theflags
record component.- Returns:
- the value of the
flags
record component
-
backgroundTexture
Returns the value of thebackgroundTexture
record component.- Returns:
- the value of the
backgroundTexture
record component
-
x
public float x()Returns the value of thex
record component.- Returns:
- the value of the
x
record component
-
y
public float y()Returns the value of they
record component.- Returns:
- the value of the
y
record component
-