Record Class PlayerInfoPacket.AddPlayer
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.PlayerInfoPacket.AddPlayer
- All Implemented Interfaces:
ComponentHolder<PlayerInfoPacket.AddPlayer>
,PlayerInfoPacket.Entry
,Writeable
- Enclosing class:
- PlayerInfoPacket
public static record PlayerInfoPacket.AddPlayer(UUID uuid, String name, List<PlayerInfoPacket.AddPlayer.Property> properties, GameMode gameMode, int ping, Component displayName)
extends Record
implements PlayerInfoPacket.Entry, ComponentHolder<PlayerInfoPacket.AddPlayer>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAddPlayer
(UUID uuid, String name, List<PlayerInfoPacket.AddPlayer.Property> properties, GameMode gameMode, int ping, Component displayName) Creates an instance of aAddPlayer
record class.AddPlayer
(UUID uuid, BinaryReader reader) -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<Component>
Gets the components held by this object.@NotNull PlayerInfoPacket.AddPlayer
copyWithOperator
(@NotNull UnaryOperator<Component> operator) Returns a copy of this object.Returns the value of thedisplayName
record component.final boolean
Indicates whether some other object is "equal to" this one.gameMode()
Returns the value of thegameMode
record component.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.int
ping()
Returns the value of theping
record component.Returns the value of theproperties
record component.final String
toString()
Returns a string representation of this record class.uuid()
Returns the value of theuuid
record component.void
write
(BinaryWriter writer) Writes into aBinaryWriter
.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
-
AddPlayer
public AddPlayer(UUID uuid, String name, List<PlayerInfoPacket.AddPlayer.Property> properties, GameMode gameMode, int ping, Component displayName) Creates an instance of aAddPlayer
record class.- Parameters:
uuid
- the value for theuuid
record componentname
- the value for thename
record componentproperties
- the value for theproperties
record componentgameMode
- the value for thegameMode
record componentping
- the value for theping
record componentdisplayName
- the value for thedisplayName
record component
-
AddPlayer
-
-
Method Details
-
write
Description copied from interface:Writeable
Writes into aBinaryWriter
. -
components
Description copied from interface:ComponentHolder
Gets the components held by this object.- Specified by:
components
in interfaceComponentHolder<PlayerInfoPacket.AddPlayer>
- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull PlayerInfoPacket.AddPlayer 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<PlayerInfoPacket.AddPlayer>
- 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 '=='. -
uuid
Returns the value of theuuid
record component.- Specified by:
uuid
in interfacePlayerInfoPacket.Entry
- Returns:
- the value of the
uuid
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
properties
Returns the value of theproperties
record component.- Returns:
- the value of the
properties
record component
-
gameMode
Returns the value of thegameMode
record component.- Returns:
- the value of the
gameMode
record component
-
ping
public int ping()Returns the value of theping
record component.- Returns:
- the value of the
ping
record component
-
displayName
Returns the value of thedisplayName
record component.- Returns:
- the value of the
displayName
record component
-