Class UUIDChecker
java.lang.Object
preponderous.ponder.minecraft.bukkit.tools.UUIDChecker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindPlayerNameBasedOnUUID(UUID playerUUID)
Method to obtain the name of a player based on their UUID.findUUIDBasedOnPlayerName(String playerName)
Method to obtain the UUID of a player based on their known name.
-
Constructor Details
-
UUIDChecker
public UUIDChecker()
-
-
Method Details
-
findPlayerNameBasedOnUUID
Method to obtain the name of a player based on their UUID.This method utilises
Bukkit.getOfflinePlayer(UUID)
andBukkit.getPlayer(UUID)
to obtain the player object, to then usesOfflinePlayer
andPlayer
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
Method to obtain the UUID of a player based on their known name.This method utilises
Bukkit.getOfflinePlayer(String)
andBukkit.getPlayer(String)
to obtain the player object, to then usesOfflinePlayer
andPlayer
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.
-