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, String fmlVersion)
extends Record
implements Packet<ServerHandshakePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
The field for thefmlVersion
record component.private 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
(int protocolVersion, String hostName, int port, ClientIntent intention, String fmlVersion) Creates an instance of aClientIntentionPacket
record class.ClientIntentionPacket
(FriendlyByteBuf p_179801_) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefmlVersion
record component.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. -
fmlVersion
The field for thefmlVersion
record component. -
MAX_HOST_LENGTH
private static final int MAX_HOST_LENGTH- See Also:
-
-
Constructor Details
-
ClientIntentionPacket
public ClientIntentionPacket(int protocolVersion, String hostName, int port, ClientIntent intention, String fmlVersion) 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 componentfmlVersion
- the value for thefmlVersion
record component
-
ClientIntentionPacket
@Deprecated public ClientIntentionPacket(int protocolVersion, String hostName, int port, ClientIntent intention) Deprecated. -
ClientIntentionPacket
-
-
Method Details
-
write
- Specified by:
write
in interfacePacket<ServerHandshakePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ServerHandshakePacketListener>
-
nextProtocol
- Specified by:
nextProtocol
in interfacePacket<ServerHandshakePacketListener>
-
getFMLVersion
-
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
-
fmlVersion
Returns the value of thefmlVersion
record component.- Returns:
- the value of the
fmlVersion
record component
-