diff --git a/src/main/java/co/runed/multicharacter/MultiCharacterMod.java b/src/main/java/co/runed/multicharacter/MultiCharacterMod.java index b397e04..7376215 100644 --- a/src/main/java/co/runed/multicharacter/MultiCharacterMod.java +++ b/src/main/java/co/runed/multicharacter/MultiCharacterMod.java @@ -1,9 +1,8 @@ package co.runed.multicharacter; -import co.runed.multicharacter.api.IMultiCharacterIntegration; +import co.runed.multicharacter.addons.minecraft.MinecraftAddon; import co.runed.multicharacter.api.MultiCharacterAPI; import co.runed.multicharacter.character.CharacterManager; -import co.runed.multicharacter.integration.minecraft.MinecraftIntegration; import co.runed.multicharacter.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -38,7 +37,9 @@ public void preInit(FMLPreInitializationEvent event) logger = event.getModLog(); this.characterManager = new CharacterManager(); - MultiCharacterAPI.addIntegration(new MinecraftIntegration()); + MultiCharacterAPI.addAddon(new MinecraftAddon()); + + MultiCharacterAPI.addAddonIfModLoaded("moreplayermodels", "co.runed.multicharacter.addons.mpm.MPMAddon"); proxy.preInit(); } @@ -53,13 +54,6 @@ public void init(FMLInitializationEvent event) public void postInit(FMLPostInitializationEvent event) { proxy.postInit(); - - MultiCharacterAPI.addIntegrationIfModLoaded("moreplayermodels", "co.runed.multicharacter.integration.mpm.MPMIntegration"); - - for (IMultiCharacterIntegration integration : MultiCharacterAPI.getIntegrations()) - { - integration.init(); - } } public static MultiCharacterMod getInstance() diff --git a/src/main/java/co/runed/multicharacter/integration/minecraft/CharacterLoadingTeleporter.java b/src/main/java/co/runed/multicharacter/addons/minecraft/CharacterLoadingTeleporter.java similarity index 92% rename from src/main/java/co/runed/multicharacter/integration/minecraft/CharacterLoadingTeleporter.java rename to src/main/java/co/runed/multicharacter/addons/minecraft/CharacterLoadingTeleporter.java index 8623f09..884839b 100644 --- a/src/main/java/co/runed/multicharacter/integration/minecraft/CharacterLoadingTeleporter.java +++ b/src/main/java/co/runed/multicharacter/addons/minecraft/CharacterLoadingTeleporter.java @@ -1,4 +1,4 @@ -package co.runed.multicharacter.integration.minecraft; +package co.runed.multicharacter.addons.minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; diff --git a/src/main/java/co/runed/multicharacter/integration/minecraft/MinecraftIntegration.java b/src/main/java/co/runed/multicharacter/addons/minecraft/MinecraftAddon.java similarity index 95% rename from src/main/java/co/runed/multicharacter/integration/minecraft/MinecraftIntegration.java rename to src/main/java/co/runed/multicharacter/addons/minecraft/MinecraftAddon.java index f635aa2..209a51a 100644 --- a/src/main/java/co/runed/multicharacter/integration/minecraft/MinecraftIntegration.java +++ b/src/main/java/co/runed/multicharacter/addons/minecraft/MinecraftAddon.java @@ -1,7 +1,7 @@ -package co.runed.multicharacter.integration.minecraft; +package co.runed.multicharacter.addons.minecraft; import co.runed.multicharacter.MultiCharacterMod; -import co.runed.multicharacter.api.IMultiCharacterIntegration; +import co.runed.multicharacter.api.Addon; import co.runed.multicharacter.api.MultiCharacterAPI; import co.runed.multicharacter.character.Character; import co.runed.multicharacter.character.CharacterManager; @@ -22,7 +22,7 @@ import java.io.FileInputStream; import java.io.IOException; -public class MinecraftIntegration implements IMultiCharacterIntegration +public class MinecraftAddon extends Addon { public static final String PLAYER_DATA_NBT_KEY = "PlayerData"; @@ -32,12 +32,6 @@ public void init() } - @Override - public void clientInit() - { - - } - @Override public void onPreLoad(EntityPlayer player) { @@ -139,7 +133,7 @@ public void onSave(EntityPlayer player) { // WRITE PLAYER.DAT NBT TO CHARACTER NBT NBTTagCompound nbt = activeCharacter.getNbt(); - nbt.setTag(MinecraftIntegration.PLAYER_DATA_NBT_KEY, player.writeToNBT(new NBTTagCompound())); + nbt.setTag(MinecraftAddon.PLAYER_DATA_NBT_KEY, player.writeToNBT(new NBTTagCompound())); activeCharacter.setNbt(nbt); } diff --git a/src/main/java/co/runed/multicharacter/integration/mpm/MPMIntegration.java b/src/main/java/co/runed/multicharacter/addons/mpm/MPMAddon.java similarity index 91% rename from src/main/java/co/runed/multicharacter/integration/mpm/MPMIntegration.java rename to src/main/java/co/runed/multicharacter/addons/mpm/MPMAddon.java index bea77fd..cd490fb 100644 --- a/src/main/java/co/runed/multicharacter/integration/mpm/MPMIntegration.java +++ b/src/main/java/co/runed/multicharacter/addons/mpm/MPMAddon.java @@ -1,32 +1,28 @@ -package co.runed.multicharacter.integration.mpm; +package co.runed.multicharacter.addons.mpm; import co.runed.multicharacter.MultiCharacterMod; -import co.runed.multicharacter.api.IMultiCharacterIntegration; +import co.runed.multicharacter.addons.mpm.packets.CPacketUpdateMPM; +import co.runed.multicharacter.addons.mpm.packets.SPacketSaveMPM; +import co.runed.multicharacter.api.Addon; import co.runed.multicharacter.character.Character; import co.runed.multicharacter.character.CharacterManager; import co.runed.multicharacter.network.PacketDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.relauncher.Side; import noppes.mpm.ModelData; -public class MPMIntegration implements IMultiCharacterIntegration +public class MPMAddon extends Addon { public static final String NBT_DATA_KEY = "MorePlayerModels"; @Override public void init() { + this.setClientAddon(new MPMClientAddon()); + PacketDispatcher.registerPacket(CPacketUpdateMPM.Handler.class, CPacketUpdateMPM.class, Side.CLIENT); PacketDispatcher.registerPacket(SPacketSaveMPM.Handler.class, SPacketSaveMPM.class, Side.SERVER); - - MinecraftForge.EVENT_BUS.register(this); - } - - @Override - public void clientInit() - { } @Override diff --git a/src/main/java/co/runed/multicharacter/addons/mpm/MPMClientAddon.java b/src/main/java/co/runed/multicharacter/addons/mpm/MPMClientAddon.java new file mode 100644 index 0000000..129e3ad --- /dev/null +++ b/src/main/java/co/runed/multicharacter/addons/mpm/MPMClientAddon.java @@ -0,0 +1,31 @@ +package co.runed.multicharacter.addons.mpm; + +import co.runed.multicharacter.addons.mpm.packets.SPacketSaveMPM; +import co.runed.multicharacter.api.ClientAddon; +import co.runed.multicharacter.events.client.GuiCloseEvent; +import co.runed.multicharacter.network.PacketDispatcher; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import noppes.mpm.client.gui.GuiMPM; + +public class MPMClientAddon extends ClientAddon +{ + @Override + public void init() + { + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + public void onCloseGui(GuiCloseEvent event) + { + GuiScreen gui = event.getGui(); + + // TODO: MOVE TO MPM INTEGRATION + if (gui != null && gui.getClass() == GuiMPM.class) + { + PacketDispatcher.sendToServer(new SPacketSaveMPM(((GuiMPM) gui).playerdata)); + } + } +} diff --git a/src/main/java/co/runed/multicharacter/integration/mpm/MPMUtil.java b/src/main/java/co/runed/multicharacter/addons/mpm/MPMUtil.java similarity index 92% rename from src/main/java/co/runed/multicharacter/integration/mpm/MPMUtil.java rename to src/main/java/co/runed/multicharacter/addons/mpm/MPMUtil.java index 8620591..d8e99f4 100644 --- a/src/main/java/co/runed/multicharacter/integration/mpm/MPMUtil.java +++ b/src/main/java/co/runed/multicharacter/addons/mpm/MPMUtil.java @@ -1,6 +1,7 @@ -package co.runed.multicharacter.integration.mpm; +package co.runed.multicharacter.addons.mpm; import co.runed.multicharacter.MultiCharacterMod; +import co.runed.multicharacter.addons.mpm.packets.CPacketUpdateMPM; import co.runed.multicharacter.character.Character; import co.runed.multicharacter.network.PacketDispatcher; import co.runed.multicharacter.util.Scheduler; @@ -37,7 +38,7 @@ public static ModelData setModelData(EntityPlayer player, ModelData modelData) if (character != null) { NBTTagCompound nbt = character.getNbt(); - nbt.setTag(MPMIntegration.NBT_DATA_KEY, data.writeToNBT()); + nbt.setTag(MPMAddon.NBT_DATA_KEY, data.writeToNBT()); character.setNbt(nbt); } } diff --git a/src/main/java/co/runed/multicharacter/integration/mpm/CPacketUpdateMPM.java b/src/main/java/co/runed/multicharacter/addons/mpm/packets/CPacketUpdateMPM.java similarity index 92% rename from src/main/java/co/runed/multicharacter/integration/mpm/CPacketUpdateMPM.java rename to src/main/java/co/runed/multicharacter/addons/mpm/packets/CPacketUpdateMPM.java index b2c9246..420156e 100644 --- a/src/main/java/co/runed/multicharacter/integration/mpm/CPacketUpdateMPM.java +++ b/src/main/java/co/runed/multicharacter/addons/mpm/packets/CPacketUpdateMPM.java @@ -1,5 +1,6 @@ -package co.runed.multicharacter.integration.mpm; +package co.runed.multicharacter.addons.mpm.packets; +import co.runed.multicharacter.addons.mpm.MPMUtil; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/co/runed/multicharacter/integration/mpm/SPacketSaveMPM.java b/src/main/java/co/runed/multicharacter/addons/mpm/packets/SPacketSaveMPM.java similarity index 93% rename from src/main/java/co/runed/multicharacter/integration/mpm/SPacketSaveMPM.java rename to src/main/java/co/runed/multicharacter/addons/mpm/packets/SPacketSaveMPM.java index 279cf28..abef6c4 100644 --- a/src/main/java/co/runed/multicharacter/integration/mpm/SPacketSaveMPM.java +++ b/src/main/java/co/runed/multicharacter/addons/mpm/packets/SPacketSaveMPM.java @@ -1,6 +1,7 @@ -package co.runed.multicharacter.integration.mpm; +package co.runed.multicharacter.addons.mpm.packets; import co.runed.multicharacter.MultiCharacterMod; +import co.runed.multicharacter.addons.mpm.MPMUtil; import io.netty.buffer.ByteBuf; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fml.common.network.ByteBufUtils; diff --git a/src/main/java/co/runed/multicharacter/api/Addon.java b/src/main/java/co/runed/multicharacter/api/Addon.java new file mode 100644 index 0000000..8ad6898 --- /dev/null +++ b/src/main/java/co/runed/multicharacter/api/Addon.java @@ -0,0 +1,18 @@ +package co.runed.multicharacter.api; + +public abstract class Addon implements IAddon +{ + IClientAddon clientAddon; + + @Override + public IClientAddon getClientAddon() + { + return this.clientAddon; + } + + @Override + public void setClientAddon(IClientAddon clientAddon) + { + this.clientAddon = clientAddon; + } +} diff --git a/src/main/java/co/runed/multicharacter/api/ClientAddon.java b/src/main/java/co/runed/multicharacter/api/ClientAddon.java new file mode 100644 index 0000000..ec7dc86 --- /dev/null +++ b/src/main/java/co/runed/multicharacter/api/ClientAddon.java @@ -0,0 +1,5 @@ +package co.runed.multicharacter.api; + +public abstract class ClientAddon implements IClientAddon +{ +} diff --git a/src/main/java/co/runed/multicharacter/api/IMultiCharacterIntegration.java b/src/main/java/co/runed/multicharacter/api/IAddon.java similarity index 93% rename from src/main/java/co/runed/multicharacter/api/IMultiCharacterIntegration.java rename to src/main/java/co/runed/multicharacter/api/IAddon.java index 2b68728..d39294c 100644 --- a/src/main/java/co/runed/multicharacter/api/IMultiCharacterIntegration.java +++ b/src/main/java/co/runed/multicharacter/api/IAddon.java @@ -3,11 +3,13 @@ import co.runed.multicharacter.character.Character; import net.minecraft.entity.player.EntityPlayer; -public interface IMultiCharacterIntegration +public interface IAddon { void init(); - void clientInit(); + IClientAddon getClientAddon(); + + void setClientAddon(IClientAddon clientAddon); /** * Runs before a players characters are loaded diff --git a/src/main/java/co/runed/multicharacter/api/IClientAddon.java b/src/main/java/co/runed/multicharacter/api/IClientAddon.java new file mode 100644 index 0000000..d1cef15 --- /dev/null +++ b/src/main/java/co/runed/multicharacter/api/IClientAddon.java @@ -0,0 +1,6 @@ +package co.runed.multicharacter.api; + +public interface IClientAddon +{ + void init(); +} diff --git a/src/main/java/co/runed/multicharacter/api/MultiCharacterAPI.java b/src/main/java/co/runed/multicharacter/api/MultiCharacterAPI.java index d893068..49d997d 100644 --- a/src/main/java/co/runed/multicharacter/api/MultiCharacterAPI.java +++ b/src/main/java/co/runed/multicharacter/api/MultiCharacterAPI.java @@ -4,6 +4,7 @@ import net.minecraft.world.World; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.relauncher.Side; import java.io.File; import java.util.ArrayList; @@ -11,7 +12,7 @@ public class MultiCharacterAPI { - private static final List modIntegrations = new ArrayList<>(); + private static final List addons = new ArrayList<>(); public static File getCharacterDirectory(EntityPlayer player) { @@ -28,18 +29,37 @@ public static File getCharacterDirectory(EntityPlayer player) return dir; } - public static void addIntegration(IMultiCharacterIntegration integration) + public static void initAddons() { - modIntegrations.add(integration); + for (IAddon addon : addons) + { + addon.init(); + } + + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + for (IAddon addon : addons) + { + if (addon.getClientAddon() != null) + { + addon.getClientAddon().init(); + } + } + } + } + + public static void addAddon(IAddon addon) + { + addons.add(addon); } - public static void addIntegrationIfModLoaded(String requiredMod, String className) + public static void addAddonIfModLoaded(String requiredMod, String className) { if (Loader.isModLoaded(requiredMod)) { try { - addIntegration(Class.forName(className).asSubclass(IMultiCharacterIntegration.class).newInstance()); + addAddon(Class.forName(className).asSubclass(IAddon.class).newInstance()); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { @@ -48,8 +68,8 @@ public static void addIntegrationIfModLoaded(String requiredMod, String classNam } } - public static List getIntegrations() + public static List getAddons() { - return modIntegrations; + return addons; } } diff --git a/src/main/java/co/runed/multicharacter/character/CharacterManager.java b/src/main/java/co/runed/multicharacter/character/CharacterManager.java index 8ba2a69..4e1ee4a 100644 --- a/src/main/java/co/runed/multicharacter/character/CharacterManager.java +++ b/src/main/java/co/runed/multicharacter/character/CharacterManager.java @@ -1,6 +1,6 @@ package co.runed.multicharacter.character; -import co.runed.multicharacter.api.IMultiCharacterIntegration; +import co.runed.multicharacter.api.IAddon; import co.runed.multicharacter.api.MultiCharacterAPI; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -152,14 +152,14 @@ public void deserializeCharacters(NBTTagCompound nbt) public void save(EntityPlayer player) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onPreSave(player); } - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onSave(player); } @@ -167,14 +167,14 @@ public void save(EntityPlayer player) public void load(EntityPlayer player) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onPreLoad(player); } - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onLoad(player); } @@ -182,11 +182,11 @@ public void load(EntityPlayer player) public void onDisconnect(EntityPlayer player) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); this.save(player); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onDisconnect(player); } @@ -202,9 +202,9 @@ public void onDisconnect(EntityPlayer player) public void onSelectCharacter(EntityPlayer player, Character character) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onSelectCharacter(player, character); } @@ -212,9 +212,9 @@ public void onSelectCharacter(EntityPlayer player, Character character) public void onCreateCharacter(EntityPlayer player, Character character) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onCreateCharacter(player, character); } @@ -222,9 +222,9 @@ public void onCreateCharacter(EntityPlayer player, Character character) public void onChangeDimension(EntityPlayer player, int fromDim, int toDim) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onChangeDimension(player, fromDim, toDim); } @@ -232,9 +232,9 @@ public void onChangeDimension(EntityPlayer player, int fromDim, int toDim) public void onRespawn(EntityPlayer player) { - List integrations = MultiCharacterAPI.getIntegrations(); + List integrations = MultiCharacterAPI.getAddons(); - for (IMultiCharacterIntegration loader : integrations) + for (IAddon loader : integrations) { loader.onRespawn(player); } diff --git a/src/main/java/co/runed/multicharacter/events/client/ClientGuiEventHandler.java b/src/main/java/co/runed/multicharacter/events/client/ClientGuiEventHandler.java index 2811a60..62f287e 100644 --- a/src/main/java/co/runed/multicharacter/events/client/ClientGuiEventHandler.java +++ b/src/main/java/co/runed/multicharacter/events/client/ClientGuiEventHandler.java @@ -1,14 +1,13 @@ package co.runed.multicharacter.events.client; -import co.runed.multicharacter.integration.mpm.SPacketSaveMPM; import co.runed.multicharacter.network.PacketDispatcher; import co.runed.multicharacter.network.packets.SPacketOpenCharacterGui; import net.minecraft.client.gui.GuiDownloadTerrain; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent; -import noppes.mpm.client.gui.GuiMPM; public class ClientGuiEventHandler { @@ -21,23 +20,25 @@ public void clientDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent this.shownCharacterGui = false; } + @SubscribeEvent + public void onCloseGui(GuiCloseEvent event) + { + GuiScreen gui = event.getGui(); + + // OPEN CHARACTER SELECTION GUI ON CONNECT (AFTER DOWNLOAD TERRAIN GUI HAS BEEN SHOWN FOR THE FIRST TIME) + if (gui != null && gui.getClass() == GuiDownloadTerrain.class && !shownCharacterGui) + { + this.shownCharacterGui = true; + PacketDispatcher.sendToServer(new SPacketOpenCharacterGui()); + } + } + @SubscribeEvent public void onOpenGui(GuiOpenEvent event) { if (event.getGui() == null) { - // OPEN CHARACTER SELECTION GUI ON CONNECT (AFTER DOWNLOAD TERRAIN GUI HAS BEEN SHOWN FOR THE FIRST TIME) - if (previousGui != null && previousGui.getClass() == GuiDownloadTerrain.class && !shownCharacterGui) - { - this.shownCharacterGui = true; - PacketDispatcher.sendToServer(new SPacketOpenCharacterGui()); - } - - // TODO: MOVE TO MPM INTEGRATION - if (previousGui != null && previousGui.getClass() == GuiMPM.class) - { - PacketDispatcher.sendToServer(new SPacketSaveMPM(((GuiMPM) previousGui).playerdata)); - } + MinecraftForge.EVENT_BUS.post(new GuiCloseEvent(previousGui)); previousGui = event.getGui(); return; diff --git a/src/main/java/co/runed/multicharacter/events/client/GuiCloseEvent.java b/src/main/java/co/runed/multicharacter/events/client/GuiCloseEvent.java new file mode 100644 index 0000000..1f24074 --- /dev/null +++ b/src/main/java/co/runed/multicharacter/events/client/GuiCloseEvent.java @@ -0,0 +1,25 @@ +package co.runed.multicharacter.events.client; + +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class GuiCloseEvent extends Event +{ + private GuiScreen gui; + + public GuiCloseEvent(GuiScreen gui) + { + this.setGui(gui); + } + + public GuiScreen getGui() + { + return gui; + } + + public void setGui(GuiScreen gui) + { + this.gui = gui; + } + +} diff --git a/src/main/java/co/runed/multicharacter/proxy/ClientProxy.java b/src/main/java/co/runed/multicharacter/proxy/ClientProxy.java index 93ca080..10562f9 100644 --- a/src/main/java/co/runed/multicharacter/proxy/ClientProxy.java +++ b/src/main/java/co/runed/multicharacter/proxy/ClientProxy.java @@ -1,7 +1,5 @@ package co.runed.multicharacter.proxy; -import co.runed.multicharacter.api.IMultiCharacterIntegration; -import co.runed.multicharacter.api.MultiCharacterAPI; import co.runed.multicharacter.client.ModKeys; import co.runed.multicharacter.events.client.ClientGuiEventHandler; import co.runed.multicharacter.events.client.ClientInputEventHandler; @@ -30,10 +28,5 @@ public void preInit() public void postInit() { super.postInit(); - - for (IMultiCharacterIntegration integration : MultiCharacterAPI.getIntegrations()) - { - integration.clientInit(); - } } } diff --git a/src/main/java/co/runed/multicharacter/proxy/CommonProxy.java b/src/main/java/co/runed/multicharacter/proxy/CommonProxy.java index 42e0bba..2684fcd 100644 --- a/src/main/java/co/runed/multicharacter/proxy/CommonProxy.java +++ b/src/main/java/co/runed/multicharacter/proxy/CommonProxy.java @@ -1,5 +1,6 @@ package co.runed.multicharacter.proxy; +import co.runed.multicharacter.api.MultiCharacterAPI; import co.runed.multicharacter.events.server.PlayerConnectionEventHandler; import co.runed.multicharacter.events.server.PlayerIOEventHandler; import co.runed.multicharacter.network.PacketDispatcher; @@ -14,6 +15,8 @@ public void preInit() MinecraftForge.EVENT_BUS.register(new PlayerConnectionEventHandler()); PacketDispatcher.init(); + + MultiCharacterAPI.initAddons(); } public void init()