Class BedrockPlayer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongclientID()Retrieves the client ID of the Bedrock player.@Nullable StringdeviceId()Retrieves the device ID of the Bedrock player.@Nullable StringRetrieves the device model associated with the Bedrock player.booleanform(@NotNull org.geysermc.cumulus.form.Form form) Sends a form to a Bedrock player if applicable.static booleanChecks if the Floodgate integration is active.static booleanChecks if there is a Geyser instance available.@Nullable StringDetermines the input mode used by the Bedrock player, if applicable.static booleanisBedrockPlayer(UUID uuid) Determines whether the specified player, identified by their UUID, is a Bedrock player.booleanDetermines if the current player is a Floodgate player.static booleanisFloodgatePlayer(String uuid) Checks if a given UUID string represents a Floodgate player by verifying if it starts with the Floodgate UUID prefix.static booleanisFloodgatePlayer(UUID uuid) Determines if a player with the given UUID is a Floodgate player.static BedrockPlayerCreates a newBedrockPlayerinstance from the providedPlayer.longping()Retrieves the ping value of a Bedrock player if applicable.@NonNull Stringplatform()Determines the platform type of the player.@NotNull Playerplayer()Retrieves the associated player instance.intRetrieves the subscription ID of the current Bedrock player instance if available.@Nullable Stringxuid()Retrieves the XUID (Xbox User ID) of the Bedrock player.
-
Constructor Details
-
BedrockPlayer
-
-
Method Details
-
of
Creates a newBedrockPlayerinstance from the providedPlayer.- Parameters:
player- thePlayerto convert to aBedrockPlayer; must not be null- Returns:
- a new
BedrockPlayerinstance associated with the givenPlayer
-
isBedrockPlayer
Determines whether the specified player, identified by their UUID, is a Bedrock player.- Parameters:
uuid- the universally unique identifier (UUID) of the player to check- Returns:
- true if the specified player is a Bedrock player, otherwise false
-
isFloodgatePlayer
Checks if a given UUID string represents a Floodgate player by verifying if it starts with the Floodgate UUID prefix.- Parameters:
uuid- the UUID string of the player, expected to contain dashes and not null- Returns:
trueif the UUID represents a Floodgate player,falseotherwise
-
isFloodgatePlayer
Determines if a player with the given UUID is a Floodgate player.- Parameters:
uuid- the universally unique identifier (UUID) of the player to check- Returns:
- true if the player is a Floodgate player, false otherwise
-
hasGeyser
public static boolean hasGeyser()Checks if there is a Geyser instance available.- Returns:
- true if a Geyser instance is available; false otherwise
-
hasFloodgate
public static boolean hasFloodgate()Checks if the Floodgate integration is active.- Returns:
- true if Floodgate is enabled, false otherwise
-
player
Retrieves the associated player instance.- Returns:
- the
Playerinstance associated with this object; never null
-
isFloodgatePlayer
public boolean isFloodgatePlayer()Determines if the current player is a Floodgate player.A Floodgate player is a Bedrock player connected through the Floodgate plugin.
- Returns:
- true if the player is a Floodgate player, false otherwise
-
platform
Determines the platform type of the player.- Returns:
- the platform type of the player as a non-null string. Possible values include specific platform names from Floodgate or Geyser, or "Java Edition" for non-Bedrock players.
-
subscribeId
public int subscribeId()Retrieves the subscription ID of the current Bedrock player instance if available.The method checks whether the player is a Floodgate player and returns their associated subscription ID. If the player is not a Floodgate player or the Bedrock player instance is null, it returns -1.
- Returns:
- the subscription ID of the Floodgate player, or -1 if unavailable
-
deviceId
Retrieves the device ID of the Bedrock player.If the player is a Bedrock player and Geyser is enabled, this method fetches the device ID associated with the player's session.
- Returns:
- the device ID of the player, or
nullif the player is not a Bedrock player, Geyser is not enabled, or if the device ID is unavailable
-
deviceModel
Retrieves the device model associated with the Bedrock player.If the player is a Bedrock player and the Geyser integration is available, this method fetches the device model from the client's data.
- Returns:
- the device model of the Bedrock player as a string, or
nullif unavailable
-
inputMode
Determines the input mode used by the Bedrock player, if applicable.The input mode can vary based on the Bedrock player's connection and settings, such as Floodgate or Geyser integration.
- Returns:
- a string representation of the input mode if the Bedrock player is connected via Floodgate or Geyser; otherwise, returns null if the input mode cannot be determined or is not applicable.
-
clientID
public long clientID()Retrieves the client ID of the Bedrock player.This method checks if the player instance is associated with Bedrock through Geyser. If so, it fetches the client random ID from the Geyser session. If the player is not a Bedrock player or the Geyser instance is not available, it returns a default value of -1.
- Returns:
- the client ID as a long if the player is a Geyser Bedrock player; -1 otherwise
-
xuid
Retrieves the XUID (Xbox User ID) of the Bedrock player.The method checks if the player is associated with Floodgate or Geyser and retrieves the XUID accordingly.
- Returns:
- the XUID of the Bedrock player as a string, or null if unavailable
-
form
public boolean form(@NotNull @NotNull org.geysermc.cumulus.form.Form form) Sends a form to a Bedrock player if applicable.The form will be sent through Floodgate or Geyser, depending on the player's platform.
- Parameters:
form- the form to be sent to the player; must not be null- Returns:
- true if the form was successfully sent; false otherwise
-
ping
public long ping()Retrieves the ping value of a Bedrock player if applicable.This method checks if the associated player is a Bedrock player and if the Geyser integration is available.
- Returns:
- the ping value in milliseconds for a Bedrock player, or -1 if the player is not a Bedrock player or Geyser is not available.
-