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
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thehostNamerecord component.private final ClientIntentThe field for theintentionrecord component.private static final intprivate final intThe field for theportrecord component.private final intThe field for theprotocolVersionrecord component.static final StreamCodec<FriendlyByteBuf, ClientIntentionPacket> -
Constructor Summary
ConstructorsModifierConstructorDescriptionClientIntentionPacket(int protocolVersion, String hostName, int port, ClientIntent intention) Deprecated.privateClientIntentionPacket(FriendlyByteBuf p_179801_) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidhandle(ServerHandshakePacketListener p_134734_) final inthashCode()Returns a hash code value for this object.hostName()Returns the value of thehostNamerecord component.Returns the value of theintentionrecord component.booleanintport()Returns the value of theportrecord component.intReturns the value of theprotocolVersionrecord component.final StringtoString()Returns a string representation of this record class.type()private voidwrite(FriendlyByteBuf p_134737_) 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
-
protocolVersion
private final int protocolVersionThe field for theprotocolVersionrecord component. -
hostName
The field for thehostNamerecord component. -
port
private final int portThe field for theportrecord component. -
intention
The field for theintentionrecord component. -
STREAM_CODEC
-
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 aClientIntentionPacketrecord class.- Parameters:
protocolVersion- the value for theprotocolVersionrecord componenthostName- the value for thehostNamerecord componentport- the value for theportrecord componentintention- the value for theintentionrecord component
-
ClientIntentionPacket
-
-
Method Details
-
write
-
type
- Specified by:
typein interfacePacket<ServerHandshakePacketListener>
-
handle
- Specified by:
handlein interfacePacket<ServerHandshakePacketListener>
-
isTerminal
public boolean isTerminal()- Specified by:
isTerminalin 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 theprotocolVersionrecord component.- Returns:
- the value of the
protocolVersionrecord component
-
hostName
Returns the value of thehostNamerecord component.- Returns:
- the value of the
hostNamerecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
intention
Returns the value of theintentionrecord component.- Returns:
- the value of the
intentionrecord component
-