Fix resolvePlayer method

This commit is contained in:
Andre601 2020-12-31 18:20:11 +01:00
parent e8b5660eda
commit 8fa0f73a46
1 changed files with 6 additions and 3 deletions

View File

@ -212,12 +212,15 @@ public final class CommandParse extends PlaceholderCommand {
@Nullable
private OfflinePlayer resolvePlayer(@NotNull final String name) {
OfflinePlayer target = Bukkit.getPlayer(name);
if (target == null) {
target = Bukkit.getOfflinePlayer(name); // this is probably not a great idea.
// Not the best option, but Spigot doesn't offer a good replacement (as usual)
target = Bukkit.getOfflinePlayer(name);
return target.hasPlayedBefore() ? target : null;
}
return target.hasPlayedBefore() ? target : null;
return target;
}