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 net.kyori.adventure.text.Component title, @NotNull net.kyori.adventure.text.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
ConstructorsConstructorDescriptionDisplayData(@NotNull net.kyori.adventure.text.Component title, @NotNull net.kyori.adventure.text.Component description, @NotNull ItemStack icon, @NotNull FrameType frameType, int flags, @Nullable String backgroundTexture, float x, float y) Creates an instance of aDisplayDatarecord class.DisplayData(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of thebackgroundTexturerecord component.@NotNull Collection<net.kyori.adventure.text.Component> Gets the components held by this object.@NotNull AdvancementsPacket.DisplayDatacopyWithOperator(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Returns a copy of this object.@NotNull net.kyori.adventure.text.ComponentReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.intflags()Returns the value of theflagsrecord component.@NotNull FrameTypeReturns the value of theframeTyperecord component.final inthashCode()Returns a hash code value for this object.@NotNull ItemStackicon()Returns the value of theiconrecord component.@NotNull net.kyori.adventure.text.Componenttitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.voidwrite(@NotNull NetworkBuffer writer) floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minestom.server.adventure.ComponentHolder
visitComponents
-
Constructor Details
-
DisplayData
-
DisplayData
public DisplayData(@NotNull @NotNull net.kyori.adventure.text.Component title, @NotNull @NotNull net.kyori.adventure.text.Component description, @NotNull @NotNull ItemStack icon, @NotNull @NotNull FrameType frameType, int flags, @Nullable @Nullable String backgroundTexture, float x, float y) Creates an instance of aDisplayDatarecord class.- Parameters:
title- the value for thetitlerecord componentdescription- the value for thedescriptionrecord componenticon- the value for theiconrecord componentframeType- the value for theframeTyperecord componentflags- the value for theflagsrecord componentbackgroundTexture- the value for thebackgroundTexturerecord componentx- the value for thexrecord componenty- the value for theyrecord component
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
components
Description copied from interface:ComponentHolderGets the components held by this object.- Specified by:
componentsin interfaceComponentHolder<AdvancementsPacket.DisplayData>- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull AdvancementsPacket.DisplayData copyWithOperator(@NotNull @NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Description copied from interface:ComponentHolderReturns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperatorin 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
@NotNull public @NotNull net.kyori.adventure.text.Component title()Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
description
@NotNull public @NotNull net.kyori.adventure.text.Component description()Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
frameType
Returns the value of theframeTyperecord component.- Returns:
- the value of the
frameTyperecord component
-
flags
public int flags()Returns the value of theflagsrecord component.- Returns:
- the value of the
flagsrecord component
-
backgroundTexture
Returns the value of thebackgroundTexturerecord component.- Returns:
- the value of the
backgroundTexturerecord component
-
x
public float x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public float y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-