mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
make the update checker run later on fabric
This commit is contained in:
5 files changed
+12
-3
No files matched your search
@@ -127,12 +127,16 @@ public abstract class CarbonChatInternal implements CarbonChat {
|
|||||||
this.channelRegistry().loadConfigChannels(this.carbonMessages);
|
this.channelRegistry().loadConfigChannels(this.carbonMessages);
|
||||||
|
|
||||||
this.messagingManager.get();
|
this.messagingManager.get();
|
||||||
|
}
|
||||||
|
|
||||||
CompletableFuture.runAsync(() -> {
|
protected final void checkVersion() {
|
||||||
if (!this.injector.getInstance(ConfigManager.class).primaryConfig().updateChecker()) {
|
if (!this.injector.getInstance(ConfigManager.class).primaryConfig().updateChecker()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new UpdateChecker(this.logger).checkVersion();
|
CompletableFuture.runAsync(() -> new UpdateChecker(this.logger).checkVersion()).whenComplete(($, thr) -> {
|
||||||
|
if (thr != null) {
|
||||||
|
this.logger.warn("Exception fetching version information", thr);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public final class CarbonChatFabric extends CarbonChatInternal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void registerServerLifecycleListeners() {
|
private void registerServerLifecycleListeners() {
|
||||||
|
ServerLifecycleEvents.SERVER_STARTED.register(server -> this.checkVersion());
|
||||||
ServerLifecycleEvents.SERVER_STOPPED.register(server -> this.shutdown());
|
ServerLifecycleEvents.SERVER_STOPPED.register(server -> this.shutdown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import org.checkerframework.framework.qual.DefaultQualifier;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public final class MinecraftServerHolder {
|
public final class MinecraftServerHolder {
|
||||||
|
|
||||||
private @Nullable MinecraftServer server;
|
private volatile @Nullable MinecraftServer server;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private MinecraftServerHolder() {
|
private MinecraftServerHolder() {
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ public final class CarbonChatPaper extends CarbonChatInternal {
|
|||||||
|
|
||||||
final Metrics metrics = new Metrics(this.plugin, BSTATS_PLUGIN_ID);
|
final Metrics metrics = new Metrics(this.plugin, BSTATS_PLUGIN_ID);
|
||||||
metrics.addCustomChart(new SimplePie("user_manager_type", () -> this.injector().getInstance(ConfigManager.class).primaryConfig().storageType().name()));
|
metrics.addCustomChart(new SimplePie("user_manager_type", () -> this.injector().getInstance(ConfigManager.class).primaryConfig().storageType().name()));
|
||||||
|
|
||||||
|
this.checkVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void discoverDiscordHooks() {
|
private void discoverDiscordHooks() {
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ public class CarbonChatVelocity extends CarbonChatInternal {
|
|||||||
for (final Class<? extends VelocityListener<?>> clazz : LISTENER_CLASSES) {
|
for (final Class<? extends VelocityListener<?>> clazz : LISTENER_CLASSES) {
|
||||||
this.injector().getInstance(clazz).register(this.proxyServer.getEventManager(), carbonVelocityBootstrap);
|
this.injector().getInstance(clazz).register(this.proxyServer.getEventManager(), carbonVelocityBootstrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.checkVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onShutdown() {
|
public void onShutdown() {
|
||||||
|
|||||||
Reference in new issue
Block a user