From 9167face1260f8c02c93234b8d003d5ade779295 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Sat, 24 Oct 2020 17:41:45 +0200 Subject: [PATCH] Fix timeUntilKickOfflinePlayer; resolves #826 --- core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java | 2 ++ .../main/java/de/erethon/dungeonsxl/player/DPlayerListener.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java index c95b84e8..7e2c2819 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java +++ b/core/src/main/java/de/erethon/dungeonsxl/DungeonsXL.java @@ -788,6 +788,8 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI { } dPlayer.setPlayer(player); + playerCache.remove(dPlayer); + playerCache.add(player, dPlayer); dPlayer.setOfflineTimeMillis(0); return true; } diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java b/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java index fdf61762..1d2d16aa 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DPlayerListener.java @@ -449,9 +449,11 @@ public class DPlayerListener implements Listener { } else if (timeUntilKickOfflinePlayer > 0) { dGroup.sendMessage(DMessage.PLAYER_OFFLINE.getMessage(dPlayer.getName(), String.valueOf(timeUntilKickOfflinePlayer)), player); ((GamePlayer) dPlayer).setOfflineTimeMillis(System.currentTimeMillis() + timeUntilKickOfflinePlayer * 1000); + return; } else { dGroup.sendMessage(DMessage.PLAYER_OFFLINE_NEVER.getMessage(dPlayer.getName()), player); + return; } } else if (dPlayer instanceof InstancePlayer) {