mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
getPlayerUniqueId API
Gets the unique ID of the player currently known as the specified player name In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
This commit is contained in:
parent
4447307899
commit
635e3fa1fa
2 changed files with 26 additions and 0 deletions
|
@ -753,6 +753,20 @@ public final class Bukkit {
|
|||
return server.getPlayer(id);
|
||||
}
|
||||
|
||||
// Paper start
|
||||
/**
|
||||
* Gets the unique ID of the player currently known as the specified player name
|
||||
* In Offline Mode, will return an Offline UUID
|
||||
*
|
||||
* @param playerName the player name to look up the unique ID for
|
||||
* @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode
|
||||
*/
|
||||
@Nullable
|
||||
public static UUID getPlayerUniqueId(@NotNull String playerName) {
|
||||
return server.getPlayerUniqueId(playerName);
|
||||
}
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
* Gets the plugin manager for interfacing with plugins.
|
||||
*
|
||||
|
|
|
@ -633,6 +633,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|||
@Nullable
|
||||
public Player getPlayer(@NotNull UUID id);
|
||||
|
||||
// Paper start
|
||||
/**
|
||||
* Gets the unique ID of the player currently known as the specified player name
|
||||
* In Offline Mode, will return an Offline UUID
|
||||
*
|
||||
* @param playerName the player name to look up the unique ID for
|
||||
* @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode
|
||||
*/
|
||||
@Nullable
|
||||
public UUID getPlayerUniqueId(@NotNull String playerName);
|
||||
// Paper end
|
||||
|
||||
/**
|
||||
* Gets the plugin manager for interfacing with plugins.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue