use object for PlayerData instead of hashmap

This commit is contained in:
YouHaveTrouble
2021-02-19 02:54:51 +01:00
parent b9a4286a64
commit 905861079f
21 changed files with 107 additions and 81 deletions
@@ -11,7 +11,7 @@ public class CombatTimer {
public static void refreshPlayersCombatTime(UUID uuid) {
try {
long now = Instant.now().getEpochSecond();
long combattime = (long) SmartCache.getPlayerData(uuid).get("combattime");
long combattime = SmartCache.getPlayerData(uuid).getCombattime();
if (combattime < now) {
PluginMessages.sendActionBar(uuid, TogglePvP.getPlugin().getConfigCache().getEntering_combat());
}
@@ -26,7 +26,7 @@ public class CombatTimer {
public static boolean isInCombat(UUID uuid) {
try {
long combattimer = (long) SmartCache.getPlayerData(uuid).get("combattime");
long combattimer = SmartCache.getPlayerData(uuid).getCombattime();
long now = Instant.now().getEpochSecond();
return combattimer > now;
} catch (Exception e) {