mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-15 23:04:45 +00:00
externalize event handling from config system to avoid classloading issues
This commit is contained in:
7 files changed
+199
-80
No files matched your search
@@ -22,6 +22,8 @@ package com.falsepattern.lib.internal.proxy;
|
||||
|
||||
import com.falsepattern.lib.internal.Share;
|
||||
import com.falsepattern.lib.internal.Tags;
|
||||
import com.falsepattern.lib.internal.impl.config.event.ClientEventHandlerPost;
|
||||
import com.falsepattern.lib.internal.impl.config.event.ClientEventHandlerPre;
|
||||
import com.falsepattern.lib.internal.impl.toast.GuiToastImpl;
|
||||
import com.falsepattern.lib.updates.UpdateChecker;
|
||||
import lombok.val;
|
||||
@@ -55,12 +57,14 @@ public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent e) {
|
||||
super.preInit(e);
|
||||
ClientEventHandlerPre.registerBus();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent e) {
|
||||
super.postInit(e);
|
||||
ClientEventHandlerPost.registerBus();
|
||||
chatFuture = updatesFuture.handleAsync((updates, exception) -> {
|
||||
if (exception != null || updates.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -23,8 +23,8 @@ package com.falsepattern.lib.internal.proxy;
|
||||
import com.falsepattern.lib.internal.FalsePatternLib;
|
||||
import com.falsepattern.lib.internal.Share;
|
||||
import com.falsepattern.lib.internal.config.LibraryConfig;
|
||||
import com.falsepattern.lib.internal.impl.config.ConfigSyncEventHandler;
|
||||
import com.falsepattern.lib.internal.impl.config.ConfigurationManagerImpl;
|
||||
import com.falsepattern.lib.internal.impl.config.event.CommonEventHandlerPost;
|
||||
import com.falsepattern.lib.internal.impl.config.event.CommonEventHandlerPre;
|
||||
import com.falsepattern.lib.internal.impl.config.net.SyncPrompt;
|
||||
import com.falsepattern.lib.internal.impl.config.net.SyncPromptHandler;
|
||||
import com.falsepattern.lib.internal.impl.config.net.SyncReply;
|
||||
@@ -55,7 +55,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void preInit(FMLPreInitializationEvent e) {
|
||||
ConfigurationManagerImpl.registerBus();
|
||||
CommonEventHandlerPre.registerBus();
|
||||
if (LibraryConfig.ENABLE_UPDATE_CHECKER) {
|
||||
Share.LOG.info("Launching asynchronous update check.");
|
||||
updatesFuture = UpdateChecker.fetchUpdatesAsync(FalsePatternLib.UPDATE_URL).thenApplyAsync(updates -> {
|
||||
@@ -81,7 +81,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent e) {
|
||||
ConfigSyncEventHandler.registerBus();
|
||||
CommonEventHandlerPost.registerBus();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user