Don't send error when joining for the first time

This commit is contained in:
Eric 2018-11-04 14:24:27 +01:00
parent 51e16febe7
commit 7df4f4b69d
2 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,7 @@ public class NotifyPlayerOnJoinListener implements Listener {
@Override @Override
public void onResult(Long result) { public void onResult(Long result) {
if (result < 0) { if (result < 0) {
p.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED, // No logout saved, probably first time joining.
new Replacement(Placeholder.ERROR, "Could not get last time you logged out")));
return; return;
} }

View File

@ -543,6 +543,7 @@ public abstract class Database {
* @param player Player who logged out * @param player Player who logged out
* @param callback Callback that - if succeeded - returns the time in * @param callback Callback that - if succeeded - returns the time in
* milliseconds the player logged out (as {@code long}) * 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<Long> callback) { public void getLastLogout(final Player player, final Callback<Long> callback) {
new BukkitRunnable() { new BukkitRunnable() {