mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2025-02-19 21:21:20 +01:00
Attempt to fix OfflinePlayer bug
This commit is contained in:
parent
8447f245d5
commit
c7065ea9fa
@ -19,7 +19,7 @@ public class PlayerUtils {
|
||||
public static OfflinePlayer getOfflinePlayer(String playerNameOrUUID) {
|
||||
OfflinePlayer player = tryGetFromUUID(playerNameOrUUID);
|
||||
|
||||
if (player != null) {
|
||||
if (player != null && player.hasPlayedBefore()) {
|
||||
return player;
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ public class PlayerUtils {
|
||||
|
||||
private static OfflinePlayer tryGetFromUUID(String possibleUUID) {
|
||||
UUID uuid;
|
||||
OfflinePlayer player;
|
||||
|
||||
try {
|
||||
uuid = UUID.fromString(possibleUUID);
|
||||
@ -45,6 +46,12 @@ public class PlayerUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
player = Bukkit.getServer().getPlayer(uuid);
|
||||
|
||||
if (player != null) {
|
||||
return player;
|
||||
}
|
||||
|
||||
return Bukkit.getServer().getOfflinePlayer(uuid);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user