Record Class ClientHandshakePacket
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.client.handshake.ClientHandshakePacket
- All Implemented Interfaces:
NetworkBuffer.Writer,ClientPacket
public record ClientHandshakePacket(int protocolVersion, @NotNull String serverAddress, int serverPort, int intent)
extends Record
implements ClientPacket
-
Constructor Summary
ConstructorsConstructorDescriptionClientHandshakePacket(int protocolVersion, @NotNull String serverAddress, int serverPort, int intent) Creates an instance of aClientHandshakePacketrecord class.ClientHandshakePacket(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intintent()Returns the value of theintentrecord component.intReturns the value of theprotocolVersionrecord component.@NotNull StringReturns the value of theserverAddressrecord component.intReturns the value of theserverPortrecord component.final StringtoString()Returns a string representation of this record class.voidwrite(@NotNull NetworkBuffer writer)
-
Constructor Details
-
ClientHandshakePacket
public ClientHandshakePacket(int protocolVersion, @NotNull @NotNull String serverAddress, int serverPort, int intent) Creates an instance of aClientHandshakePacketrecord class.- Parameters:
protocolVersion- the value for theprotocolVersionrecord componentserverAddress- the value for theserverAddressrecord componentserverPort- the value for theserverPortrecord componentintent- the value for theintentrecord component
-
ClientHandshakePacket
-
-
Method Details
-
write
- Specified by:
writein interfaceNetworkBuffer.Writer
-
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 '=='. -
protocolVersion
public int protocolVersion()Returns the value of theprotocolVersionrecord component.- Returns:
- the value of the
protocolVersionrecord component
-
serverAddress
Returns the value of theserverAddressrecord component.- Returns:
- the value of the
serverAddressrecord component
-
serverPort
public int serverPort()Returns the value of theserverPortrecord component.- Returns:
- the value of the
serverPortrecord component
-
intent
public int intent()Returns the value of theintentrecord component.- Returns:
- the value of the
intentrecord component
-