From 530f8d6538367bf6a1da611abd51609d13c3ec43 Mon Sep 17 00:00:00 2001 From: Cow Date: Sun, 2 Aug 2020 19:10:43 +0200 Subject: Added delay to best friends online message on server join avoids it from getting buried in other server welcome messages --- src/main/java/de/cowtipper/cowlection/handler/FriendsHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/cowtipper') 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); + } } }); } -- cgit