Implement getMinepacksPlayerLoadedOnly

This commit is contained in:
GeorgH93 2021-02-22 19:14:34 +01:00
parent deb5232edb
commit e7d324537d
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
2 changed files with 8 additions and 1 deletions

View File

@ -182,6 +182,11 @@ public void onPlayerLoginEvent(final @NotNull PlayerJoinEvent event)
return player;
}
public @Nullable MinepacksPlayerExtended getPlayerCached(final @NotNull OfflinePlayer offlinePlayer)
{
return cache.getCachedPlayer(offlinePlayer.getUniqueId());
}
// DB Functions
public void saveBackpack(final @NotNull Backpack backpack)
{

View File

@ -331,7 +331,9 @@ public void getMinepacksPlayer(final @NotNull OfflinePlayer player, final @NotNu
@Override
public @Nullable MinepacksPlayerExtended getMinepacksPlayerLoadedOnly(@NotNull OfflinePlayer player)
{//TODO
{
MinepacksPlayerExtended mpPlayer = database.getPlayerCached(player);
if(mpPlayer != null && mpPlayer.isLoaded()) return mpPlayer;
return null;
}