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<String> criteria, @NotNull List<AdvancementsPacket.Requirement> requirements)
extends Record
implements NetworkBuffer.Writer, ComponentHolder<AdvancementsPacket.Advancement>
-
Constructor Summary
ConstructorDescriptionAdvancement
(@NotNull NetworkBuffer reader) Advancement
(@Nullable String parentIdentifier, @Nullable AdvancementsPacket.DisplayData displayData, @NotNull List<String> criteria, @NotNull List<AdvancementsPacket.Requirement> requirements) Creates an instance of aAdvancement
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<net.kyori.adventure.text.Component>
Gets the components held by this object.@NotNull AdvancementsPacket.Advancement
copyWithOperator
(@NotNull UnaryOperator<net.kyori.adventure.text.Component> operator) Returns a copy of this object.criteria()
Returns the value of thecriteria
record component.@Nullable AdvancementsPacket.DisplayData
Returns the value of thedisplayData
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@Nullable String
Returns the value of theparentIdentifier
record component.@NotNull List<AdvancementsPacket.Requirement>
Returns the value of therequirements
record component.final String
toString()
Returns a string representation of this record class.void
write
(@NotNull NetworkBuffer writer) 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
-
Advancement
public Advancement(@Nullable @Nullable String parentIdentifier, @Nullable @Nullable AdvancementsPacket.DisplayData displayData, @NotNull @NotNull List<String> criteria, @NotNull @NotNull List<AdvancementsPacket.Requirement> requirements) Creates an instance of aAdvancement
record class.- Parameters:
parentIdentifier
- the value for theparentIdentifier
record componentdisplayData
- the value for thedisplayData
record componentcriteria
- the value for thecriteria
record componentrequirements
- the value for therequirements
record component
-
Advancement
-
-
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.Advancement>
- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull AdvancementsPacket.Advancement copyWithOperator(@NotNull @NotNull UnaryOperator<net.kyori.adventure.text.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.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. All components in this record class are compared withObjects::equals(Object,Object)
. -
parentIdentifier
Returns the value of theparentIdentifier
record component.- Returns:
- the value of the
parentIdentifier
record component
-
displayData
Returns the value of thedisplayData
record component.- Returns:
- the value of the
displayData
record component
-
criteria
Returns the value of thecriteria
record component.- Returns:
- the value of the
criteria
record component
-
requirements
Returns the value of therequirements
record component.- Returns:
- the value of the
requirements
record component
-