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:35:26 +02:00
|
|
|
import net.minecraft.item.ItemStack
|
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-07-14 22:20:02 +02:00
|
|
|
import resonant.lib.config.ConfigHandler
|
|
|
|
import resonant.lib.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-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
|
|
|
@Mod.Metadata(References.ID)
|
|
|
|
var metadata: ModMetadata = null
|
2014-08-13 16:50:56 +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-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
loadables.applyModule(proxy)
|
|
|
|
loadables.applyModule(packetHandler)
|
|
|
|
loadables.applyModule(CoreContent)
|
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-25 14:31:19 +02:00
|
|
|
RICreativeTab.itemStack = new ItemStack(CoreContent.decoration)
|
2014-10-12 09:24:46 +02:00
|
|
|
}
|
2014-07-14 22:20:02 +02:00
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
@EventHandler
|
|
|
|
def init(evt: FMLInitializationEvent)
|
|
|
|
{
|
|
|
|
//TODO: Why is there an if statement check here?
|
|
|
|
if (ResonantInduction.metadata != null)
|
2014-09-07 05:50:03 +02:00
|
|
|
{
|
2014-10-12 09:24:46 +02:00
|
|
|
ResonantInduction.metadata.modId = Reference.name
|
|
|
|
ResonantInduction.metadata.name = Reference.name
|
|
|
|
ResonantInduction.metadata.description = Reference.name + " is a mod... TODO add description"
|
|
|
|
ResonantInduction.metadata.url = "http://calclavia.com/resonant-induction/"
|
|
|
|
ResonantInduction.metadata.version = Reference.version + Reference.build
|
|
|
|
ResonantInduction.metadata.authorList = List[String]("Calclavia", "DarkCow", "tgame14", "Maxwolf")
|
|
|
|
ResonantInduction.metadata.autogenerated = false
|
2014-10-05 00:12:13 +02:00
|
|
|
}
|
|
|
|
|
2014-10-12 09:24:46 +02:00
|
|
|
ResonantPartFactory.init()
|
|
|
|
ResonantEngine.resourceFactory.generateAll()
|
|
|
|
loadables.init()
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
def postInit(evt: FMLPostInitializationEvent)
|
|
|
|
{
|
|
|
|
loadables.postInit()
|
|
|
|
}
|
2014-07-14 22:20:02 +02:00
|
|
|
}
|