diff --git a/codechicken/multipart/handler/modcontainer.scala b/codechicken/multipart/handler/modcontainer.scala index 4827eaa..b24e043 100644 --- a/codechicken/multipart/handler/modcontainer.scala +++ b/codechicken/multipart/handler/modcontainer.scala @@ -4,9 +4,8 @@ import cpw.mods.fml.common.network.NetworkMod import cpw.mods.fml.common.Mod import cpw.mods.fml.common.event.FMLPostInitializationEvent import cpw.mods.fml.common.event.FMLPreInitializationEvent -import cpw.mods.fml.common.Mod.PreInit -import cpw.mods.fml.common.Mod.PostInit -import cpw.mods.fml.common.Mod.ServerAboutToStart +import cpw.mods.fml.common.event.FMLInitializationEvent +import cpw.mods.fml.common.Mod.EventHandler import cpw.mods.fml.common.event.FMLServerAboutToStartEvent import codechicken.multipart.MultiPartRegistry import cpw.mods.fml.relauncher.SideOnly @@ -17,13 +16,19 @@ import codechicken.lib.packet.PacketCustom.CustomTinyPacketHandler @NetworkMod(clientSideRequired = true, serverSideRequired = true, tinyPacketHandler=classOf[CustomTinyPacketHandler]) object MultipartMod { - @PreInit + @EventHandler def preInit(event:FMLPreInitializationEvent) { MultipartProxy.preInit(event.getModConfigurationDirectory) } - @PostInit + @EventHandler + def init(event:FMLInitializationEvent) + { + MultipartProxy.init() + } + + @EventHandler def postInit(event:FMLPostInitializationEvent) { if(MultiPartRegistry.required) @@ -33,7 +38,7 @@ object MultipartMod } } - @ServerAboutToStart + @EventHandler def beforeServerStart(event:FMLServerAboutToStartEvent) { MultiPartRegistry.beforeServerStart() diff --git a/codechicken/multipart/handler/proxies.scala b/codechicken/multipart/handler/proxies.scala index 375b5ac..04b0c18 100644 --- a/codechicken/multipart/handler/proxies.scala +++ b/codechicken/multipart/handler/proxies.scala @@ -44,11 +44,14 @@ class MultipartProxy_serverImpl MultipartSaveLoad.hookLoader() } - def postInit() + def init() { block = new BlockMultipart(config.getTag("block.id").getIntValue(getFreeBlockID(1281))) block.setUnlocalizedName("ccmultipart") - + } + + def postInit() + { MinecraftForge.EVENT_BUS.register(MultipartEventHandler) PacketCustom.assignHandler(MultipartSPH.channel, MultipartSPH) NetworkRegistry.instance.registerConnectionHandler(MultipartEventHandler)