From 7df4f4b69d85c8f47d38aa13693468fccb204a1f Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 4 Nov 2018 14:24:27 +0100 Subject: [PATCH] Don't send error when joining for the first time --- .../shopchest/listeners/NotifyPlayerOnJoinListener.java | 3 +-- src/main/java/de/epiceric/shopchest/sql/Database.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/listeners/NotifyPlayerOnJoinListener.java b/src/main/java/de/epiceric/shopchest/listeners/NotifyPlayerOnJoinListener.java index 9ba709a..a0bb1a1 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/NotifyPlayerOnJoinListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/NotifyPlayerOnJoinListener.java @@ -38,8 +38,7 @@ public class NotifyPlayerOnJoinListener implements Listener { @Override public void onResult(Long result) { if (result < 0) { - p.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED, - new Replacement(Placeholder.ERROR, "Could not get last time you logged out"))); + // No logout saved, probably first time joining. return; } diff --git a/src/main/java/de/epiceric/shopchest/sql/Database.java b/src/main/java/de/epiceric/shopchest/sql/Database.java index 466813c..3a2a53a 100644 --- a/src/main/java/de/epiceric/shopchest/sql/Database.java +++ b/src/main/java/de/epiceric/shopchest/sql/Database.java @@ -543,6 +543,7 @@ public abstract class Database { * @param player Player who logged out * @param callback Callback that - if succeeded - returns the time in * milliseconds the player logged out (as {@code long}) + * or {@code -1} if the player has not logged out yet. */ public void getLastLogout(final Player player, final Callback callback) { new BukkitRunnable() {