Record Class ClientIntentionPacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.handshake.ClientIntentionPacket
- All Implemented Interfaces:
Packet<ServerHandshakePacketListener>
public record ClientIntentionPacket(int protocolVersion, String hostName, int port, ClientIntent intention)
extends Record
implements Packet<ServerHandshakePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
The field for thehostName
record component.private final ClientIntent
The field for theintention
record component.private static final int
private final int
The field for theport
record component.private final int
The field for theprotocolVersion
record component. -
Constructor Summary
ConstructorDescriptionClientIntentionPacket
(int protocolVersion, String hostName, int port, ClientIntent intention) Deprecated.ClientIntentionPacket
(FriendlyByteBuf p_179801_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.void
handle
(ServerHandshakePacketListener p_134734_) final int
hashCode()
Returns a hash code value for this object.hostName()
Returns the value of thehostName
record component.Returns the value of theintention
record component.int
port()
Returns the value of theport
record component.int
Returns the value of theprotocolVersion
record component.final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_134737_) 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
-
protocolVersion
private final int protocolVersionThe field for theprotocolVersion
record component. -
hostName
The field for thehostName
record component. -
port
private final int portThe field for theport
record component. -
intention
The field for theintention
record component. -
MAX_HOST_LENGTH
private static final int MAX_HOST_LENGTH- See Also:
-
-
Constructor Details
-
ClientIntentionPacket
@Deprecated public ClientIntentionPacket(int protocolVersion, String hostName, int port, ClientIntent intention) Deprecated.Creates an instance of aClientIntentionPacket
record class.- Parameters:
protocolVersion
- the value for theprotocolVersion
record componenthostName
- the value for thehostName
record componentport
- the value for theport
record componentintention
- the value for theintention
record component
-
ClientIntentionPacket
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ServerHandshakePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ServerHandshakePacketListener>
-
nextProtocol
- Specified by:
nextProtocol
in interfacePacket<ServerHandshakePacketListener>
-
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 theprotocolVersion
record component.- Returns:
- the value of the
protocolVersion
record component
-
hostName
Returns the value of thehostName
record component.- Returns:
- the value of the
hostName
record component
-
port
public int port()Returns the value of theport
record component.- Returns:
- the value of the
port
record component
-
intention
Returns the value of theintention
record component.- Returns:
- the value of the
intention
record component
-