Skip to content

Commit 94a5b76

Browse files
authored
Add missing API annotation, remove confusing log message (#880)
* Mark `UpdateChecker#checkForUpdates` as `@Nullable` Signed-off-by: Lilly Rose Berner <lilly@lostluma.net> * Remove update info log when a mod update has no update Signed-off-by: Lilly Rose Berner <lilly@lostluma.net> --------- Signed-off-by: Lilly Rose Berner <lilly@lostluma.net>
1 parent f72168c commit 94a5b76

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/com/terraformersmc/modmenu/api/UpdateChecker.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.terraformersmc.modmenu.api;
22

3+
import org.jetbrains.annotations.Nullable;
4+
35
public interface UpdateChecker {
46
/**
57
* Gets called when ModMenu is checking for updates.
@@ -9,5 +11,5 @@ public interface UpdateChecker {
911
*
1012
* @return The update info
1113
*/
12-
UpdateInfo checkForUpdates();
14+
@Nullable UpdateInfo checkForUpdates();
1315
}

src/main/java/com/terraformersmc/modmenu/util/UpdateCheckerUtil.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,11 @@ private static void checkForUpdates0() {
6767
Thread.currentThread().setName("ModMenu/Update Checker/%s".formatted(mod.getName()));
6868

6969
var update = updateChecker.checkForUpdates();
70+
mod.setUpdateInfo(update);
7071

71-
if (update == null) {
72-
return;
72+
if (update != null && update.isUpdateAvailable()) {
73+
LOGGER.info("Update available for '{}@{}'", mod.getId(), mod.getVersion());
7374
}
74-
75-
mod.setUpdateInfo(update);
76-
LOGGER.info("Update available for '{}@{}'", mod.getId(), mod.getVersion());
7775
});
7876
}
7977
}

0 commit comments

Comments
 (0)