Package net.minecraft.server.network
Record Class CommonListenerCookie
java.lang.Object
java.lang.Record
net.minecraft.server.network.CommonListenerCookie
public record CommonListenerCookie(com.mojang.authlib.GameProfile gameProfile, int latency, ClientInformation clientInformation, boolean transferred, ConnectionType connectionType)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientInformationThe field for theclientInformationrecord component.private final ConnectionTypeThe field for theconnectionTyperecord component.private final com.mojang.authlib.GameProfileThe field for thegameProfilerecord component.private final intThe field for thelatencyrecord component.private final booleanThe field for thetransferredrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCommonListenerCookie(com.mojang.authlib.GameProfile gameProfile, int latency, ClientInformation clientInformation, boolean transferred) Deprecated.CommonListenerCookie(com.mojang.authlib.GameProfile gameProfile, int latency, ClientInformation clientInformation, boolean transferred, ConnectionType connectionType) Creates an instance of aCommonListenerCookierecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theclientInformationrecord component.Returns the value of theconnectionTyperecord component.static CommonListenerCookiecreateInitial(com.mojang.authlib.GameProfile pGameProfile, boolean pTransferred) final booleanIndicates whether some other object is "equal to" this one.com.mojang.authlib.GameProfileReturns the value of thegameProfilerecord component.final inthashCode()Returns a hash code value for this object.intlatency()Returns the value of thelatencyrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetransferredrecord component.
-
Field Details
-
gameProfile
private final com.mojang.authlib.GameProfile gameProfileThe field for thegameProfilerecord component. -
latency
private final int latencyThe field for thelatencyrecord component. -
clientInformation
The field for theclientInformationrecord component. -
transferred
private final boolean transferredThe field for thetransferredrecord component. -
connectionType
The field for theconnectionTyperecord component.
-
-
Constructor Details
-
CommonListenerCookie
@Deprecated public CommonListenerCookie(com.mojang.authlib.GameProfile gameProfile, int latency, ClientInformation clientInformation, boolean transferred) Deprecated.UseCommonListenerCookie(GameProfile, int, ClientInformation, boolean, net.neoforged.neoforge.network.connection.ConnectionType)instead, to indicate whether the connection is modded. -
CommonListenerCookie
public CommonListenerCookie(com.mojang.authlib.GameProfile gameProfile, int latency, ClientInformation clientInformation, boolean transferred, ConnectionType connectionType) Creates an instance of aCommonListenerCookierecord class.- Parameters:
gameProfile- the value for thegameProfilerecord componentlatency- the value for thelatencyrecord componentclientInformation- the value for theclientInformationrecord componenttransferred- the value for thetransferredrecord componentconnectionType- the value for theconnectionTyperecord component
-
-
Method Details
-
createInitial
public static CommonListenerCookie createInitial(com.mojang.authlib.GameProfile pGameProfile, boolean pTransferred) -
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 '=='. -
gameProfile
public com.mojang.authlib.GameProfile gameProfile()Returns the value of thegameProfilerecord component.- Returns:
- the value of the
gameProfilerecord component
-
latency
public int latency()Returns the value of thelatencyrecord component.- Returns:
- the value of the
latencyrecord component
-
clientInformation
Returns the value of theclientInformationrecord component.- Returns:
- the value of the
clientInformationrecord component
-
transferred
public boolean transferred()Returns the value of thetransferredrecord component.- Returns:
- the value of the
transferredrecord component
-
connectionType
Returns the value of theconnectionTyperecord component.- Returns:
- the value of the
connectionTyperecord component
-
CommonListenerCookie(GameProfile, int, ClientInformation, boolean, net.neoforged.neoforge.network.connection.ConnectionType)instead, to indicate whether the connection is modded.