Class BedrockPlayer

java.lang.Object
one.tranic.t.base.player.BedrockPlayer

public class BedrockPlayer extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    getPing(UUID uuid)
    Retrieves the ping of a player identified by their UUID.
    static @NonNull String
    Gets the platform of the player associated with the given UUID.
    static @Nullable String
    getXUID(UUID uuid)
    Retrieves the XUID (Xbox Unique Identifier) of a player identified by their UUID.
    boolean
    Checks if the player has Floodgate integration enabled.
    boolean
    Determines if the player has access to the Geyser platform compatibility integration.
    static boolean
    Determines if a player, identified by their UUID, is a Bedrock player.
    static boolean
    Determines whether the provided UUID string corresponds to a Floodgate player.
    static boolean
    Determines whether the player associated with the given UUID is a Floodgate player.
    static boolean
    sendForm(UUID uuid, org.geysermc.cumulus.form.Form form)
    Sends a form to a player identified by their UUID.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BedrockPlayer

      public BedrockPlayer()
  • Method Details

    • isBedrockPlayer

      public static boolean isBedrockPlayer(UUID uuid)
      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

      public static boolean isFloodgatePlayer(String uuid)
      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

      public static boolean isFloodgatePlayer(UUID uuid)
      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

      public static @NonNull String getPlatform(UUID uuid)
      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

      public static @Nullable String getXUID(UUID uuid)
      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

      public static boolean sendForm(UUID uuid, org.geysermc.cumulus.form.Form form)
      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 sent
      form - the form object to be sent to the player
      Returns:
      true if the form was successfully sent using Floodgate or Geyser; false otherwise
    • getPing

      public static long getPing(UUID uuid)
      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:
      true if the player has access to Geyser; false otherwise.
    • hasFloodgate

      public boolean hasFloodgate()
      Checks if the player has Floodgate integration enabled.
      Returns:
      true if the player has Floodgate integration; false otherwise.