make the update checker run later on fabric

This commit is contained in:
Jason Penilla committed 2023-09-15 14:43:26 -07:00
1 parent 340f6befb3
commit 08b8c5841d
5 files changed
+14 -5

No files matched your search

@@ -127,12 +127,16 @@ public abstract class CarbonChatInternal implements CarbonChat {
this.channelRegistry().loadConfigChannels(this.carbonMessages);
this.messagingManager.get();
}
CompletableFuture.runAsync(() -> {
if (!this.injector.getInstance(ConfigManager.class).primaryConfig().updateChecker()) {
return;
protected final void checkVersion() {
if (!this.injector.getInstance(ConfigManager.class).primaryConfig().updateChecker()) {
return;
}
CompletableFuture.runAsync(() -> new UpdateChecker(this.logger).checkVersion()).whenComplete(($, thr) -> {
if (thr != null) {
this.logger.warn("Exception fetching version information", thr);
}
new UpdateChecker(this.logger).checkVersion();
});
}