package xyz.openmodloader;

import org.apache.commons.lang3.SystemUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import xyz.openmodloader.event.EventBus;
import xyz.openmodloader.launcher.OMLStrippableTransformer;
import xyz.openmodloader.launcher.strippable.Environment;
import xyz.openmodloader.modloader.ModLoader;
import xyz.openmodloader.modloader.Version;
import xyz.openmodloader.network.*;

import java.util.function.BiConsumer;

public enum OpenModLoader {
    INSTANCE;

    private Version mcversion = new Version("1.10.2");
    private Version version = new Version("0.0.1-develop");
    private Logger logger = LogManager.getFormatterLogger("OpenModLoader");
    private EventBus eventBus = new EventBus();
    private Channel channel = ChannelManager.create("oml");
    private SidedHandler sidedHandler;

    public void minecraftConstruction(SidedHandler sidedHandler) {
        this.sidedHandler = sidedHandler;
        getLogger().info("Loading OpenModLoader " + getVersion());
        getLogger().info("Running Minecraft %s on %s using Java %s", mcversion, SystemUtils.OS_NAME, SystemUtils.JAVA_VERSION);
        ModLoader.registerMods();
        getSidedHandler().onInitialize();
        channel.createPacket("snackbar")
                .with("component", DataType.TEXT_COMPONENT)
                .handle((context, packet) -> OpenModLoader.INSTANCE.getSidedHandler().openSnackbar(packet.get("component", DataType.TEXT_COMPONENT)))
                .build();
    }

    public Version getMinecraftVersion() {
        return mcversion;
    }

    public Version getVersion() {
        return version;
    }

    public Logger getLogger() {
        return logger;
    }

    public EventBus getEventBus() {
        return eventBus;
    }

    public SidedHandler getSidedHandler() {
        return sidedHandler;
    }

    public Environment getEnvironment() {
        return OMLStrippableTransformer.getEnvironment();
    }

    public Channel getChannel() {
        return channel;
    }
}

@@ -789,39 +789,8 @@
 nnel
- = ChannelManager.create(%22oml%22)
 ;%0A  
@@ -1222,16 +1222,64 @@
  channel
+ = ChannelManager.create(%22oml%22)%0A                
 .createP
@@ -1296,16 +1296,20 @@
 ckbar%22)%0A
+    
         
@@ -1360,16 +1360,20 @@
 PONENT)%0A
+    
         

Change OpenModLoader to use the network system properly