Record Class ServerboundHelloPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ServerboundHelloPacket
- All Implemented Interfaces:
Packet<ServerLoginPacketListener>
public record ServerboundHelloPacket(String name, Optional<ProfilePublicKey.Data> publicKey, Optional<UUID> profileId)
extends Record
implements Packet<ServerLoginPacketListener>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServerboundHelloPacket(String name, Optional<ProfilePublicKey.Data> publicKey, Optional<UUID> profileId) Creates an instance of aServerboundHelloPacketrecord class.ServerboundHelloPacket(FriendlyByteBuf p_179827_) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerLoginPacketListener p_134848_) final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of theprofileIdrecord component.Returns the value of thepublicKeyrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_134851_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.protocol.Packet
isSkippable
-
Field Details
-
name
The field for thenamerecord component. -
publicKey
The field for thepublicKeyrecord component. -
profileId
The field for theprofileIdrecord component.
-
-
Constructor Details
-
ServerboundHelloPacket
-
ServerboundHelloPacket
public ServerboundHelloPacket(String name, Optional<ProfilePublicKey.Data> publicKey, Optional<UUID> profileId) Creates an instance of aServerboundHelloPacketrecord class.- Parameters:
name- the value for thenamerecord componentpublicKey- the value for thepublicKeyrecord componentprofileId- the value for theprofileIdrecord component
-
-
Method Details
-
write
- Specified by:
writein interfacePacket<ServerLoginPacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerLoginPacketListener>
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
publicKey
Returns the value of thepublicKeyrecord component.- Returns:
- the value of the
publicKeyrecord component
-
profileId
Returns the value of theprofileIdrecord component.- Returns:
- the value of the
profileIdrecord component
-