Class BedrockPlayer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longRetrieves the ping of a player identified by their UUID.static @NonNull StringgetPlatform(UUID uuid) Gets the platform of the player associated with the given UUID.static @Nullable StringRetrieves the XUID (Xbox Unique Identifier) of a player identified by their UUID.booleanChecks if the player has Floodgate integration enabled.booleanDetermines if the player has access to the Geyser platform compatibility integration.static booleanisBedrockPlayer(UUID uuid) Determines if a player, identified by their UUID, is a Bedrock player.static booleanisFloodgatePlayer(String uuid) Determines whether the provided UUID string corresponds to a Floodgate player.static booleanisFloodgatePlayer(UUID uuid) Determines whether the player associated with the given UUID is a Floodgate player.static booleanSends a form to a player identified by their UUID.
-
Constructor Details
-
BedrockPlayer
public BedrockPlayer()
-
-
Method Details
-
isBedrockPlayer
Determines if a player, identified by their UUID, is a Bedrock player.This method uses either the Floodgate or Geyser API to make the determination, depending on their availability, and falls back to checking if the player is a Floodgate player.
- Parameters:
uuid- the unique identifier of the player- Returns:
- true if the player is a Bedrock player, false otherwise
-
isFloodgatePlayer
Determines whether the provided UUID string corresponds to a Floodgate player. This method checks if the UUID string, with dashes removed, starts with a specific prefix associated with Floodgate players.- Parameters:
uuid- the UUID string to be checked, expected in the standard UUID format with dashes- Returns:
- true if the UUID belongs to a Floodgate player, false otherwise
-
isFloodgatePlayer
Determines whether the player associated with the given UUID is a Floodgate player. This method converts the UUID to a string and checks if it matches the Floodgate criteria.- Parameters:
uuid- the unique identifier (UUID) of the player to be checked- Returns:
- true if the player is identified as a Floodgate player; false otherwise
-
getPlatform
Gets the platform of the player associated with the given UUID.This method determines the player's platform using either the Floodgate or Geyser API, based on their availability. If neither API recognizes the UUID, it returns "Java Edition".
- Parameters:
uuid- the UUID of the player whose platform is being determined- Returns:
- the platform of the player as a string, or "Java Edition" if the platform cannot be determined
-
getXUID
Retrieves the XUID (Xbox Unique Identifier) of a player identified by their UUID.This method checks for the availability of the Floodgate or Geyser API and uses the corresponding integration to obtain the player's XUID.
- Parameters:
uuid- the unique identifier (UUID) of the player whose XUID is to be retrieved- Returns:
- the XUID of the player if available; otherwise,
null
-
sendForm
Sends a form to a player identified by their UUID.This method leverages either the Floodgate or Geyser API, depending on their availability, to deliver the form.
If neither API is available, the method will return false.
- Parameters:
uuid- the unique identifier of the player to whom the form should be sentform- the form object to be sent to the player- Returns:
- true if the form was successfully sent using Floodgate or Geyser; false otherwise
-
getPing
Retrieves the ping of a player identified by their UUID.This method uses the Geyser API to determine the ping of a Bedrock player if available. If the player is not a Bedrock player or the Geyser API is not available, it returns -1.
- Parameters:
uuid- the unique identifier of the player whose ping is to be retrieved- Returns:
- the ping of the player, or -1 if unable to determine
-
hasGeyser
public boolean hasGeyser()Determines if the player has access to the Geyser platform compatibility integration.- Returns:
trueif the player has access to Geyser;falseotherwise.
-
hasFloodgate
public boolean hasFloodgate()Checks if the player has Floodgate integration enabled.- Returns:
trueif the player has Floodgate integration;falseotherwise.
-