Record Class ServerboundHelloPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.login.ServerboundHelloPacket
- All Implemented Interfaces:
Packet<ServerLoginPacketListener>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionServerboundHelloPacket
(String name, Optional<UUID> profileId) Creates an instance of aServerboundHelloPacket
record class.ServerboundHelloPacket
(FriendlyByteBuf p_179827_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerLoginPacketListener p_134848_) final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.Returns the value of theprofileId
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_134851_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable
-
Field Details
-
name
The field for thename
record component. -
profileId
The field for theprofileId
record component.
-
-
Constructor Details
-
ServerboundHelloPacket
-
ServerboundHelloPacket
Creates an instance of aServerboundHelloPacket
record class.- Parameters:
name
- the value for thename
record componentprofileId
- the value for theprofileId
record component
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ServerLoginPacketListener>
-
handle
- Specified by:
handle
in 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 thename
record component.- Returns:
- the value of the
name
record component
-
profileId
Returns the value of theprofileId
record component.- Returns:
- the value of the
profileId
record component
-