aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2023-07-25 20:12:10 +0200
committerCow <cow@volloeko.de>2023-07-25 20:12:10 +0200
commitc20c0c8eb3fa5d1a7d79b9f48e02105498f8fd17 (patch)
tree6d426e88056fd3ce1aa6a6bd5719a4921f7494ff /src
parent5f34c998e735b5ba47b6b8022f64d21808b9763d (diff)
downloadCowlection-c20c0c8eb3fa5d1a7d79b9f48e02105498f8fd17.tar.gz
Cowlection-c20c0c8eb3fa5d1a7d79b9f48e02105498f8fd17.tar.bz2
Cowlection-c20c0c8eb3fa5d1a7d79b9f48e02105498f8fd17.zip
Fixed bestfriends migration message being sent when not necessary
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java b/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java
index 713902a..0420b94 100644
--- a/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java
+++ b/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java
@@ -143,14 +143,19 @@ public class PlayerListener {
isPlayerJoiningServer = false;
if (this.nextMigrationNotification < System.currentTimeMillis()) {
- this.nextMigrationNotification = System.currentTimeMillis() + 10000;
+ this.nextMigrationNotification = System.currentTimeMillis() + 600_000; // every 10 minutes
new TickDelay(() -> {
- if (MooConfig.doBestFriendsOnlineCheck || main.getFriendsHandler().getBestFriendsListSize() > 0) {
- main.getChatHelper().sendMessage(new MooChatComponent("[" + EnumChatFormatting.DARK_RED + Cowlection.MODNAME + EnumChatFormatting.RED + "] The 'best friends list' feature has been removed from this mod.").red()
- .appendSibling(new MooChatComponent(" Run " + EnumChatFormatting.GOLD + "/moo bestfriends " + EnumChatFormatting.YELLOW + "to migrate your best friends list").yellow())
- .setSuggestCommand("/moo bestfriends", false)
- .setHover(new MooChatComponent.KeyValueChatComponent("Run", "/moo bestfriends", " ")
- .appendFreshSibling(new MooChatComponent("(This message will re-appear as long as there are still names on your Cowlection best friends list)").red())));
+ if (MooConfig.doBestFriendsOnlineCheck) {
+ if (main.getFriendsHandler().getBestFriendsListSize() == 0) {
+ MooConfig.doBestFriendsOnlineCheck = false;
+ main.getConfig().syncFromFields();
+ } else {
+ main.getChatHelper().sendMessage(new MooChatComponent("[" + EnumChatFormatting.DARK_RED + Cowlection.MODNAME + EnumChatFormatting.RED + "] The 'best friends list' feature has been removed from this mod.").red()
+ .appendSibling(new MooChatComponent(" Run " + EnumChatFormatting.GOLD + "/moo bestfriends " + EnumChatFormatting.YELLOW + "to migrate your best friends list").yellow())
+ .setSuggestCommand("/moo bestfriends", false)
+ .setHover(new MooChatComponent.KeyValueChatComponent("Run", "/moo bestfriends", " ")
+ .appendFreshSibling(new MooChatComponent("(This message will re-appear as long as there are still names on your Cowlection best friends list)").red())));
+ }
}
if (MooConfig.doMonitorNotifications()) {
main.getChatHelper().sendMessage(new MooChatComponent("[" + EnumChatFormatting.DARK_RED + Cowlection.MODNAME + EnumChatFormatting.RED + "] The 'login & logout notifications filter' feature has been removed from this mod.").red()