2013-12-30 13:52:08 +10:00
|
|
|
package codechicken.microblock.handler
|
2013-05-20 17:09:57 +10:00
|
|
|
|
|
|
|
|
import cpw.mods.fml.common.Mod
|
|
|
|
|
import cpw.mods.fml.common.event.FMLInitializationEvent
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent
|
2013-11-12 17:52:14 +10:00
|
|
|
import cpw.mods.fml.common.Mod.EventHandler
|
2013-05-20 17:09:57 +10:00
|
|
|
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent
|
|
|
|
|
import codechicken.microblock.MicroMaterialRegistry
|
|
|
|
|
import codechicken.microblock.DefaultContent
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent
|
2013-08-05 23:58:18 +10:00
|
|
|
import codechicken.microblock.ConfigContent
|
2013-11-12 17:52:14 +10:00
|
|
|
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent
|
|
|
|
|
import scala.collection.JavaConversions._
|
2013-05-20 17:09:57 +10:00
|
|
|
|
2013-09-22 13:35:38 +10:00
|
|
|
@Mod(modid = "ForgeMicroblock", acceptedMinecraftVersions = "[1.6.4]",
|
2013-08-05 23:58:18 +10:00
|
|
|
dependencies="required-after:ForgeMultipart;after:*", modLanguage="scala")
|
2013-05-20 17:09:57 +10:00
|
|
|
object MicroblockMod
|
|
|
|
|
{
|
2013-11-12 17:52:14 +10:00
|
|
|
@EventHandler
|
2013-05-20 17:09:57 +10:00
|
|
|
def preInit(event:FMLPreInitializationEvent)
|
|
|
|
|
{
|
|
|
|
|
MicroblockProxy.preInit()
|
|
|
|
|
DefaultContent.load()
|
2013-08-05 23:58:18 +10:00
|
|
|
ConfigContent.parse(event.getModConfigurationDirectory)
|
2013-05-20 17:09:57 +10:00
|
|
|
}
|
|
|
|
|
|
2013-11-12 17:52:14 +10:00
|
|
|
@EventHandler
|
2013-05-20 17:09:57 +10:00
|
|
|
def init(event:FMLInitializationEvent)
|
|
|
|
|
{
|
|
|
|
|
MicroblockProxy.init()
|
2013-08-05 23:58:18 +10:00
|
|
|
ConfigContent.load()
|
2013-05-20 17:09:57 +10:00
|
|
|
}
|
|
|
|
|
|
2013-11-12 17:52:14 +10:00
|
|
|
@EventHandler
|
2013-05-20 17:09:57 +10:00
|
|
|
def postInit(event:FMLPostInitializationEvent)
|
|
|
|
|
{
|
|
|
|
|
MicroblockProxy.postInit()
|
2013-11-12 17:52:14 +10:00
|
|
|
MicroMaterialRegistry.setupIDMap()
|
2013-05-20 17:09:57 +10:00
|
|
|
}
|
|
|
|
|
|
2013-11-12 17:52:14 +10:00
|
|
|
@EventHandler
|
2013-05-20 17:09:57 +10:00
|
|
|
def beforeServerStart(event:FMLServerAboutToStartEvent)
|
|
|
|
|
{
|
|
|
|
|
MicroMaterialRegistry.setupIDMap()
|
|
|
|
|
}
|
2013-11-12 17:52:14 +10:00
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
def handleIMC(event:IMCEvent)
|
|
|
|
|
{
|
|
|
|
|
ConfigContent.handleIMC(event.getMessages)
|
|
|
|
|
}
|
2013-05-20 17:09:57 +10:00
|
|
|
}
|