aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-08-02 19:10:43 +0200
committerCow <cow@volloeko.de>2020-08-02 19:10:43 +0200
commit530f8d6538367bf6a1da611abd51609d13c3ec43 (patch)
tree19533e3f3bd57f7e70bac0cc0c965ecaac2d8d28
parentc4e0e65b1d5106cb389e0371fe66ceccd08a3129 (diff)
downloadCowlection-530f8d6538367bf6a1da611abd51609d13c3ec43.tar.gz
Cowlection-530f8d6538367bf6a1da611abd51609d13c3ec43.tar.bz2
Cowlection-530f8d6538367bf6a1da611abd51609d13c3ec43.zip
Added delay to best friends online message on server join
avoids it from getting buried in other server welcome messages
-rw-r--r--src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java b/src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java
index 6229e0e..bb4d916 100644
--- a/src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java
+++ b/src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java
@@ -192,7 +192,12 @@ public class FriendsHandler {
bestFriendsComponent.appendFreshSibling(new MooChatComponent("Failed to check " + EnumChatFormatting.DARK_RED + bestFriendsOnlineStatusWithApiErrors.size() + EnumChatFormatting.RED + " best friends' online status due to Hypixel API errors: " + EnumChatFormatting.DARK_RED + bestFriendsWithApiErrors).red());
bestFriendsOnlineStatusWithApiErrors.clear();
}
- main.getChatHelper().sendMessage(bestFriendsComponent);
+ if (isCommandTriggered) {
+ main.getChatHelper().sendMessage(bestFriendsComponent);
+ } else {
+ // delay by 4 seconds so the message doesn't get buried due to the server welcome messages
+ new TickDelay(() -> main.getChatHelper().sendMessage(bestFriendsComponent), 80);
+ }
}
});
}