mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-22 14:16:53 +01:00
Merge pull request #529 from PlaceholderAPI/fix/527-improve-parse-command
Fix resolvePlayer method
This commit is contained in:
commit
26fdedd989
@ -211,13 +211,16 @@ public final class CommandParse extends PlaceholderCommand {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private OfflinePlayer resolvePlayer(@NotNull final String name) {
|
private OfflinePlayer resolvePlayer(@NotNull final String name) {
|
||||||
OfflinePlayer target = Bukkit.getPlayer(name);
|
OfflinePlayer target = Bukkit.getPlayerExact(name);
|
||||||
|
|
||||||
if (target == null) {
|
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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user