From e1e6c4cf4577ebefcafa084aa08ab69a019a198c Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 4 May 2020 12:03:42 +0200 Subject: [PATCH] fix: changelog display after connection lost --- .../varo/listeners/PlayerJoinQuitListener.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerJoinQuitListener.java b/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerJoinQuitListener.java index 9674a83..e9ae496 100644 --- a/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerJoinQuitListener.java +++ b/varo/src/main/java/de/cliffbreak/varo/listeners/PlayerJoinQuitListener.java @@ -54,9 +54,15 @@ public class PlayerJoinQuitListener implements Listener { @Override public void run() { - e.getPlayer().sendMessage(changes.pop()); - if (changes.empty()) + if (!e.getPlayer().isOnline()) { stopScheduler(); + return; + } + if (changes.empty()) { + stopScheduler(); + return; + } + e.getPlayer().sendMessage(changes.pop()); } }, 20, 20); }