mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-02-13 13:11:21 +01:00
Will attempt to load missing Player Data, should make the plugin more reliable.
This commit is contained in:
parent
07f6c6c396
commit
15918988cf
@ -449,7 +449,16 @@ public class PlayerData {
|
||||
|
||||
@NotNull
|
||||
public static PlayerData get(@NotNull UUID uuid) {
|
||||
return Objects.requireNonNull(data.get(uuid), "Player data not loaded");
|
||||
|
||||
// Might not be null, after all
|
||||
PlayerData observedData = data.get(uuid);
|
||||
if (observedData != null) { return observedData; }
|
||||
|
||||
// Attempt to load
|
||||
load(uuid);
|
||||
|
||||
// Yes
|
||||
return Objects.requireNonNull(data.get(uuid), "Could not obtain PlayerData. Please make sure the plugin initialized correctly.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user