more api changes and javadocs

This commit is contained in:
2022-12-31 17:09:20 +01:00
parent 5abf99cd6c
commit 61908b8fab
3 changed files with 71 additions and 23 deletions
@@ -16,7 +16,7 @@ public class SmartCache {
try {
Player player = Bukkit.getPlayer(e.getKey());
if (player != null && player.isOnline()) {
PreventStabby.getPlugin().getPlayerManager().refreshPlayersCacheTime(e.getKey());
e.getValue().refreshCacheTime();
}
} catch (NullPointerException ignored) {}
}
@@ -32,8 +32,9 @@ public class SmartCache {
public PlayerData getPlayerData(UUID uuid) {
// Try to get data from cache and refresh it
try {
PreventStabby.getPlugin().getPlayerManager().refreshPlayersCacheTime(uuid);
return PreventStabby.getPlugin().getPlayerManager().getPlayer(uuid);
PlayerData data = PreventStabby.getPlugin().getPlayerManager().getPlayer(uuid);
data.refreshCacheTime();
return data;
} catch (NullPointerException e) {
// If player data is not in cache get it from database and put into cache
try {