Class UUIDChecker

java.lang.Object
preponderous.ponder.minecraft.bukkit.tools.UUIDChecker

public class UUIDChecker extends Object
  • Constructor Details

    • UUIDChecker

      public UUIDChecker()
  • Method Details

    • findPlayerNameBasedOnUUID

      public String findPlayerNameBasedOnUUID(UUID playerUUID)
      Method to obtain the name of a player based on their UUID.

      This method utilises Bukkit.getOfflinePlayer(UUID) and Bukkit.getPlayer(UUID) to obtain the player object, to then uses OfflinePlayer and Player to obtain the known name for that player.

      Parameters:
      playerUUID - used to find the name.
      Returns:
      Name of the player as a String
      Throws:
      IllegalArgumentException - if the UUID provided is null.
    • findUUIDBasedOnPlayerName

      public UUID findUUIDBasedOnPlayerName(String playerName)
      Method to obtain the UUID of a player based on their known name.

      This method utilises Bukkit.getOfflinePlayer(String) and Bukkit.getPlayer(String) to obtain the player object, to then uses OfflinePlayer and Player to obtain UUID for that player.
      As of 1.8, UUID are the only accurate way of identifying a player, therefore, the existing methodology to obtain players by name etc. etc. are deprecated.

      Parameters:
      playerName - used to find the UUID.
      Returns:
      UUID (Unique ID) of the Player.
      Throws:
      IllegalArgumentException - if the name is null.