mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
Make getNonNullPlayer work with UUIDs too (#43)
* Make getNonNullPlayer work with UUIDs too * allman
This commit is contained in:
parent
079ea1050e
commit
ce9b70bc98
@ -566,6 +566,16 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
|
||||
|
||||
protected Player getNonNullPlayer(String name)
|
||||
{
|
||||
try
|
||||
{
|
||||
UUID uuid = UUID.fromString(name);
|
||||
return Bukkit.getPlayer(uuid);
|
||||
}
|
||||
catch (IllegalArgumentException ignored)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Player player = Bukkit.getPlayer(name);
|
||||
if (player == null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user