New util method

This commit is contained in:
Jules 2023-08-27 21:54:56 +02:00
parent 9ffb28d69c
commit 1fc3c4a638

View File

@ -366,14 +366,17 @@ public class PlayerData extends SynchronizedDataHolder implements Closeable {
return mmoData.getCooldownMap().getInfo(ref).getRemaining() / 1000d;
}
@NotNull
public static PlayerData get(@NotNull MMOPlayerData playerData) {
return get(playerData.getPlayer());
}
@NotNull
public static PlayerData get(@NotNull OfflinePlayer player) {
return get(player.getUniqueId());
}
/**
* See {@link #has(UUID)}
*
* @return If player data is loaded for a player
*/
public static boolean has(Player player) {