mirror of https://github.com/plexusorg/Plex.git
Make getNonNullPlayer work with UUIDs too
This commit is contained in:
parent
079ea1050e
commit
f41e3e33ea
|
@ -566,6 +566,13 @@ 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