2015-01-14 12:06:03 +01:00
|
|
|
package edx.core
|
2014-07-14 22:20:02 +02:00
|
|
|
|
|
|
|
import cpw.mods.fml.common.Mod.EventHandler
|
2014-07-14 22:35:26 +02:00
|
|
|
import cpw.mods.fml.common.event.{FMLInitializationEvent, FMLPostInitializationEvent, FMLPreInitializationEvent}
|
2014-07-14 22:20:02 +02:00
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry
|
2015-01-09 13:17:46 +01:00
|
|
|
import cpw.mods.fml.common.{Mod, SidedProxy}
|
2015-01-14 12:06:03 +01:00
|
|
|
import edx.basic.BasicContent
|
|
|
|
import edx.core.handler.TextureHookHandler
|
|
|
|
import edx.core.resource.AutoResourceFactory
|
|
|
|
import edx.electrical.ElectricalContent
|
|
|
|
import edx.mechanical.{MechanicalContent, MicroblockHighlightHandler}
|
|
|
|
import edx.quantum.QuantumContent
|
2014-07-14 22:20:02 +02:00
|
|
|
import net.minecraftforge.common.MinecraftForge
|
|
|
|
import net.minecraftforge.common.config.Configuration
|
|
|
|
import org.modstats.{ModstatInfo, Modstats}
|
2015-01-26 12:40:32 +01:00
|
|
|
import resonantengine.core.ResonantEngine
|
|
|
|
import resonantengine.lib.mod.config.ConfigHandler
|
|
|
|
import resonantengine.lib.mod.loadable.LoadableHandler
|
2014-07-14 22:20:02 +02:00
|
|
|
|
|
|
|
/** The core module of Resonant Induction
|
|
|
|
*
|
|
|
|
* @author Calclavia */
|
2015-01-14 12:06:03 +01:00
|
|
|
@Mod(modid = Reference.id, name = Reference.name, version = Reference.version, modLanguage = "scala", dependencies = "required-after:ForgeMultipart@[1.0.0.244,);required-after:ResonantEngine;before:ThermalExpansion;before:Mekanism")
|
|
|
|
@ModstatInfo(prefix = "edx")
|
|
|
|
object Electrodynamics
|
2014-07-14 22:20:02 +02:00
|
|
|
{
|
2014-10-12 09:24:46 +02:00
|
|
|
/** Packets */
|
2015-01-11 07:18:21 +01:00
|
|
|
val packetHandler = ResonantEngine.packetHandler
|
2014-10-12 09:24:46 +02:00
|
|
|
val loadables = new LoadableHandler
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2015-01-14 12:06:03 +01:00
|
|
|
@SidedProxy(clientSide = "edx.core.ClientProxy", serverSide = "edx.core.CommonProxy")
|
2014-10-12 09:24:46 +02:00
|
|
|
var proxy: CommonProxy = _
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
@EventHandler
|
|
|
|
def preInit(evt: FMLPreInitializationEvent)
|
|
|
|
{
|
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy)
|
|
|
|
Modstats.instance.getReporter.registerMod(this)
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
Settings.config = new Configuration(evt.getSuggestedConfigurationFile)
|
|
|
|
ConfigHandler.sync(Settings, Settings.config)
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-11-23 05:01:21 +01:00
|
|
|
MinecraftForge.EVENT_BUS.register(TextureHookHandler)
|
|
|
|
MinecraftForge.EVENT_BUS.register(MicroblockHighlightHandler)
|
2015-01-09 13:17:46 +01:00
|
|
|
MinecraftForge.EVENT_BUS.register(AutoResourceFactory)
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.applyModule(proxy)
|
|
|
|
loadables.applyModule(packetHandler)
|
2015-01-14 12:06:03 +01:00
|
|
|
loadables.applyModule(BasicContent)
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.applyModule(ElectricalContent)
|
2014-10-12 11:04:54 +02:00
|
|
|
loadables.applyModule(MechanicalContent)
|
2015-01-14 12:06:03 +01:00
|
|
|
loadables.applyModule(QuantumContent)
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.preInit()
|
|
|
|
}
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
@EventHandler
|
|
|
|
def init(evt: FMLInitializationEvent)
|
|
|
|
{
|
|
|
|
ResonantPartFactory.init()
|
2015-01-09 13:17:46 +01:00
|
|
|
AutoResourceFactory.init()
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.init()
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
def postInit(evt: FMLPostInitializationEvent)
|
|
|
|
{
|
2015-01-09 13:17:46 +01:00
|
|
|
AutoResourceFactory.postInit()
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.postInit()
|
|
|
|
}
|
2014-07-14 22:20:02 +02:00
|
|
|
}
|