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
|
2014-08-13 16:50:56 +02:00
|
|
|
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
|
2014-10-05 02:14:55 +02:00
|
|
|
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
|
2014-10-05 02:14:55 +02:00
|
|
|
import resonantinduction.electrical.ElectricalContent
|
2014-11-23 05:01:21 +01:00
|
|
|
import resonantinduction.mechanical.{MechanicalContent, MicroblockHighlightHandler}
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-08-13 16:50:56 +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")
|
2014-10-05 02:14:55 +02:00
|
|
|
final object ResonantInduction
|
2014-07-14 22:20:02 +02:00
|
|
|
{
|
2014-10-12 09:24:46 +02:00
|
|
|
/** Packets */
|
|
|
|
val packetHandler = ResonantEngine.instance.packetHandler
|
|
|
|
val loadables = new LoadableHandler
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
@SidedProxy(clientSide = "resonantinduction.core.ClientProxy", serverSide = "resonantinduction.core.CommonProxy")
|
|
|
|
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)
|
2014-12-27 06:30:53 +01:00
|
|
|
MinecraftForge.EVENT_BUS.register(ResourceFactory)
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.applyModule(proxy)
|
|
|
|
loadables.applyModule(packetHandler)
|
2014-10-12 11:04:54 +02:00
|
|
|
loadables.applyModule(ArchaicContent)
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.applyModule(ElectricalContent)
|
2014-10-12 11:04:54 +02:00
|
|
|
loadables.applyModule(MechanicalContent)
|
|
|
|
loadables.applyModule(AtomicContent)
|
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-03 12:54:54 +01:00
|
|
|
ResourceFactory.init()
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.init()
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
def postInit(evt: FMLPostInitializationEvent)
|
|
|
|
{
|
2015-01-03 12:54:54 +01:00
|
|
|
ResourceFactory.generateAll()
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.postInit()
|
|
|
|
}
|
2014-07-14 22:20:02 +02:00
|
|
|
}
|