electrodynamics/src/main/scala/edx/core/Electrodynamics.scala

71 lines
2.4 KiB
Scala
Raw Normal View History

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
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
{
/** Packets */
val packetHandler = ResonantEngine.packetHandler
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")
var proxy: CommonProxy = _
2014-07-14 22:20:02 +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
Settings.config = new Configuration(evt.getSuggestedConfigurationFile)
ConfigHandler.sync(Settings, Settings.config)
2014-07-14 22:20:02 +02:00
MinecraftForge.EVENT_BUS.register(TextureHookHandler)
MinecraftForge.EVENT_BUS.register(MicroblockHighlightHandler)
MinecraftForge.EVENT_BUS.register(AutoResourceFactory)
2014-07-14 22:20:02 +02:00
loadables.applyModule(proxy)
loadables.applyModule(packetHandler)
2015-01-14 12:06:03 +01:00
loadables.applyModule(BasicContent)
loadables.applyModule(ElectricalContent)
loadables.applyModule(MechanicalContent)
2015-01-14 12:06:03 +01:00
loadables.applyModule(QuantumContent)
2014-07-14 22:20:02 +02:00
loadables.preInit()
}
2014-07-14 22:20:02 +02:00
@EventHandler
def init(evt: FMLInitializationEvent)
{
ResonantPartFactory.init()
AutoResourceFactory.init()
loadables.init()
}
@EventHandler
def postInit(evt: FMLPostInitializationEvent)
{
AutoResourceFactory.postInit()
loadables.postInit()
}
2014-07-14 22:20:02 +02:00
}