blob: 7f44a06b19b3791bb50361cd0f3d80f9d3cbd66b [file] [log] [blame] [raw]
package li.cil.oc.common
import cpw.mods.fml.common.event.FMLInitializationEvent
import cpw.mods.fml.common.event.FMLPostInitializationEvent
import cpw.mods.fml.common.event.FMLPreInitializationEvent
import cpw.mods.fml.common.registry.LanguageRegistry
import li.cil.oc.Blocks
import li.cil.oc.Config
import li.cil.oc.Items
import li.cil.oc.server.computer.Computer
import cpw.mods.fml.common.network.NetworkRegistry
import li.cil.oc.gui.GuiHandler
import li.cil.oc.OpenComputers
class CommonProxy {
def preInit(e: FMLPreInitializationEvent): Unit = {
val config = new net.minecraftforge.common.Configuration(e.getSuggestedConfigurationFile())
Config.blockComputerId = config.getBlock("computer", Config.blockComputerId,
"The block ID used for computers.").getInt(Config.blockComputerId)
Config.blockMonitorId = config.getBlock("computer", Config.blockMonitorId,
"The block ID used for monitors.").getInt(Config.blockMonitorId)
}
def init(e: FMLInitializationEvent): Unit = {
Blocks.init()
Items.init()
// TODO Figure out how resource pack based localization works.
LanguageRegistry.addName(Blocks.computer, "Computer")
NetworkRegistry.instance().registerGuiHandler(OpenComputers, new GuiHandler());
new Computer(null)
}
def postInit(e: FMLPostInitializationEvent): Unit = {}
}