Record Class AdvancementsPacket.Advancement
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.AdvancementsPacket.Advancement
- All Implemented Interfaces:
ComponentHolder<AdvancementsPacket.Advancement>,NetworkBuffer.Writer
- Enclosing class:
AdvancementsPacket
public static record AdvancementsPacket.Advancement(@Nullable String parentIdentifier, @Nullable AdvancementsPacket.DisplayData displayData, @NotNull List<AdvancementsPacket.Requirement> requirements, boolean sendTelemetryData)
extends Record
implements NetworkBuffer.Writer, ComponentHolder<AdvancementsPacket.Advancement>
-
Constructor Summary
ConstructorsConstructorDescriptionAdvancement(@Nullable String parentIdentifier, @Nullable AdvancementsPacket.DisplayData displayData, @NotNull List<AdvancementsPacket.Requirement> requirements, boolean sendTelemetryData) Creates an instance of aAdvancementrecord class.Advancement(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<net.kyori.adventure.text.Component> Gets the components held by this object.@NotNull AdvancementsPacket.AdvancementcopyWithOperator(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Returns a copy of this object.@Nullable AdvancementsPacket.DisplayDataReturns the value of thedisplayDatarecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable StringReturns the value of theparentIdentifierrecord component.@NotNull List<AdvancementsPacket.Requirement> Returns the value of therequirementsrecord component.booleanReturns the value of thesendTelemetryDatarecord component.final StringtoString()Returns a string representation of this record class.voidwrite(@NotNull NetworkBuffer writer) 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
-
Advancement
public Advancement(@Nullable @Nullable String parentIdentifier, @Nullable @Nullable AdvancementsPacket.DisplayData displayData, @NotNull @NotNull List<AdvancementsPacket.Requirement> requirements, boolean sendTelemetryData) Creates an instance of aAdvancementrecord class.- Parameters:
parentIdentifier- the value for theparentIdentifierrecord componentdisplayData- the value for thedisplayDatarecord componentrequirements- the value for therequirementsrecord componentsendTelemetryData- the value for thesendTelemetryDatarecord component
-
Advancement
-
-
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.Advancement>- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull AdvancementsPacket.Advancement 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.Advancement>- 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 '=='. -
parentIdentifier
Returns the value of theparentIdentifierrecord component.- Returns:
- the value of the
parentIdentifierrecord component
-
displayData
Returns the value of thedisplayDatarecord component.- Returns:
- the value of the
displayDatarecord component
-
requirements
Returns the value of therequirementsrecord component.- Returns:
- the value of the
requirementsrecord component
-
sendTelemetryData
public boolean sendTelemetryData()Returns the value of thesendTelemetryDatarecord component.- Returns:
- the value of the
sendTelemetryDatarecord component
-