electrodynamics/src/main/scala/resonantinduction/core/ResonantInduction.scala

73 lines
2.6 KiB
Scala
Raw Normal View History

2014-07-14 22:20:02 +02:00
package resonantinduction.core
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, ModMetadata, SidedProxy}
2014-07-14 22:20:02 +02:00
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.common.config.Configuration
import org.modstats.{ModstatInfo, Modstats}
2014-08-15 15:59:41 +02:00
import resonant.engine.{References, ResonantEngine}
2014-12-09 23:46:07 +01:00
import resonant.lib.mod.config.ConfigHandler
import resonant.lib.mod.loadable.LoadableHandler
import resonantinduction.archaic.ArchaicContent
import resonantinduction.atomic.AtomicContent
2014-07-14 22:20:02 +02:00
import resonantinduction.core.handler.TextureHookHandler
2014-12-27 06:30:53 +01:00
import resonantinduction.core.resource.ResourceFactory
import resonantinduction.electrical.ElectricalContent
import resonantinduction.mechanical.{MechanicalContent, MicroblockHighlightHandler}
2014-07-14 22:20:02 +02:00
import scala.collection.convert.wrapAll._
2014-07-14 22:20:02 +02:00
/** The core module of Resonant Induction
*
* @author Calclavia */
2014-07-16 00:58:44 +02:00
@Mod(modid = Reference.coreID, name = Reference.name, version = Reference.version, modLanguage = "scala", dependencies = "required-after:ForgeMultipart@[1.0.0.244,);required-after:ResonantEngine;before:ThermalExpansion;before:Mekanism")
2014-07-14 22:20:02 +02:00
@ModstatInfo(prefix = "resonantin")
final object ResonantInduction
2014-07-14 22:20:02 +02:00
{
/** Packets */
val packetHandler = ResonantEngine.instance.packetHandler
val loadables = new LoadableHandler
2014-07-14 22:20:02 +02:00
@SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.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)
2014-12-27 06:30:53 +01:00
MinecraftForge.EVENT_BUS.register(ResourceFactory)
2014-07-14 22:20:02 +02:00
loadables.applyModule(proxy)
loadables.applyModule(packetHandler)
loadables.applyModule(ArchaicContent)
loadables.applyModule(ElectricalContent)
loadables.applyModule(MechanicalContent)
loadables.applyModule(AtomicContent)
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()
2015-01-03 12:54:54 +01:00
ResourceFactory.init()
loadables.init()
}
@EventHandler
def postInit(evt: FMLPostInitializationEvent)
{
2015-01-03 12:54:54 +01:00
ResourceFactory.generateAll()
loadables.postInit()
}
2014-07-14 22:20:02 +02:00
}