Package com.comphenix.protocol.wrappers
Class PlayerInfoData
java.lang.Object
com.comphenix.protocol.wrappers.PlayerInfoData
Represents an immutable PlayerInfoData in the PLAYER_INFO packet.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerInfoData(WrappedGameProfile profile, int latency, EnumWrappers.NativeGameMode gameMode, WrappedChatComponent displayName) PlayerInfoData(WrappedGameProfile profile, int latency, EnumWrappers.NativeGameMode gameMode, WrappedChatComponent displayName, WrappedProfilePublicKey.WrappedProfileKeyData keyData) PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName) Constructs a new PlayerInfoData for Minecraft 1.19 or later without signature dataPlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, boolean showHat, int listOrder, WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.4 or later.PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, boolean showHat, WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.4 or later.PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, int listOrder, WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.2 or later.PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, WrappedProfilePublicKey.WrappedProfileKeyData profileKeyData) Deprecated.PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.19.3 or later. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic EquivalentConverter<PlayerInfoData> Used to convert between NMS PlayerInfoData and the wrapper instance.Gets the display name of the player represented by this data.Gets the GameMode of the player represented by this data.intGets the latency between the client and the server.intGets the priority of this entry in the tab list (since 1.21.2)intgetPing()Deprecated.Gets the GameProfile of the player represented by this data.Get the id of the affected profile (since 1.19.3)Returns the public key of the profile (since 1.19).Returns the remoteChatSessionData (since 1.19.3)inthashCode()booleanisListed()Gets if the player is listed on the client (since 1.19.3)booleanGets if a hat is shown (since 1.21.4)toString()
-
Constructor Details
-
PlayerInfoData
public PlayerInfoData(WrappedGameProfile profile, int latency, EnumWrappers.NativeGameMode gameMode, WrappedChatComponent displayName) -
PlayerInfoData
public PlayerInfoData(WrappedGameProfile profile, int latency, EnumWrappers.NativeGameMode gameMode, WrappedChatComponent displayName, WrappedProfilePublicKey.WrappedProfileKeyData keyData) -
PlayerInfoData
public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName) Constructs a new PlayerInfoData for Minecraft 1.19 or later without signature data- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)- See Also:
-
PlayerInfoData
public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, @Nullable WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.19.3 or later.- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)remoteChatSession- the remote chat session for this profile or null
-
PlayerInfoData
@Deprecated public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, @Nullable WrappedProfilePublicKey.WrappedProfileKeyData profileKeyData) Deprecated.Constructs a new PlayerInfoData for Minecraft 1.19. This is incompatible on 1.19.3.- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)profileKeyData- the public key for the profile or null- See Also:
-
PlayerInfoData
public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, int listOrder, @Nullable WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.2 or later.- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)listOrder- the priority of this entry in the tab listremoteChatSession- the remote chat session for this profile or null
-
PlayerInfoData
public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, boolean showHat, @Nullable WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.4 or later.- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)showHat- whether a hat should be shownremoteChatSession- the remote chat session for this profile or null
-
PlayerInfoData
public PlayerInfoData(UUID profileId, int latency, boolean listed, EnumWrappers.NativeGameMode gameMode, WrappedGameProfile profile, WrappedChatComponent displayName, boolean showHat, int listOrder, @Nullable WrappedRemoteChatSessionData remoteChatSession) Constructs a new PlayerInfoData for Minecraft 1.21.4 or later.- Parameters:
profileId- the id of the profile (has to be non-null)latency- the latency in millisecondslisted- whether the player is listed in the tab listgameMode- the game modeprofile- the game profiledisplayName- display name in tab list (optional)showHat- whether a hat should be shownlistOrder- the priority of this entry in the tab listremoteChatSession- the remote chat session for this profile or null
-
-
Method Details
-
getProfileId
Get the id of the affected profile (since 1.19.3)- Returns:
- the id of the profile
-
getProfile
Gets the GameProfile of the player represented by this data.- Returns:
- The GameProfile
-
getPing
Deprecated.Replaced bygetLatency() -
getLatency
public int getLatency()Gets the latency between the client and the server.- Returns:
- The latency
-
isListed
public boolean isListed()Gets if the player is listed on the client (since 1.19.3)- Returns:
- if the player is listed
-
getGameMode
Gets the GameMode of the player represented by this data.- Returns:
- The GameMode
-
getDisplayName
Gets the display name of the player represented by this data.- Returns:
- The display name
-
isShowHat
public boolean isShowHat()Gets if a hat is shown (since 1.21.4)- Returns:
- if the hat is shown
-
getListOrder
public int getListOrder()Gets the priority of this entry in the tab list (since 1.21.2)- Returns:
- the priority of this entry in the tab list
-
getProfileKeyData
Returns the public key of the profile (since 1.19). Returns the public key of the remote chat session since 1.19.3- Returns:
- The public key of the profile.
-
getRemoteChatSessionData
Returns the remoteChatSessionData (since 1.19.3)- Returns:
- The remote chat sesion data or null
-
getConverter
Used to convert between NMS PlayerInfoData and the wrapper instance.- Returns:
- A new converter.
-
equals
-
hashCode
public int hashCode() -
toString
-
getLatency()