Make getNonNullPlayer work with UUIDs too

This commit is contained in:
Luna 2022-05-17 13:07:56 -03:00
parent 079ea1050e
commit f41e3e33ea
1 changed files with 7 additions and 0 deletions

View File

@ -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)
{