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 whether the player associated with the given UUID is a Bedrock player.static booleanSends a form to a player identified by their UUID.
-
Constructor Details
-
BedrockPlayer
public BedrockPlayer()
-
-
Method Details
-
isBedrockPlayer
Determines whether the player associated with the given UUID is a Bedrock player.This method checks if the UUID belongs to a Bedrock player, utilizing either the Floodgate or Geyser API based on the availability of these integrations.
- Parameters:
uuid- The UUID of the player to check.- Returns:
trueif the player is a Bedrock player;falseotherwise.
-
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.
-