2016-03-16 17:49:28 +03:00
|
|
|
package emt;
|
2014-03-29 12:13:50 +01:00
|
|
|
|
2015-11-09 21:57:44 +03:00
|
|
|
import ic2.core.Ic2Items;
|
2014-09-27 20:16:22 -07:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2014-03-29 12:13:50 +01:00
|
|
|
import cpw.mods.fml.common.Mod;
|
|
|
|
|
import cpw.mods.fml.common.Mod.EventHandler;
|
|
|
|
|
import cpw.mods.fml.common.Mod.Instance;
|
|
|
|
|
import cpw.mods.fml.common.SidedProxy;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
2014-09-27 22:54:43 +02:00
|
|
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
2014-03-29 12:13:50 +01:00
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
2015-09-05 23:03:28 +03:00
|
|
|
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
2016-03-16 17:49:28 +03:00
|
|
|
import emt.command.CommandOutputs;
|
2016-03-17 18:25:51 +03:00
|
|
|
import emt.init.EMTEntities;
|
2016-03-16 17:49:28 +03:00
|
|
|
import emt.init.Registry;
|
2016-03-17 18:25:51 +03:00
|
|
|
import emt.init.EMTResearches;
|
2016-03-16 17:49:28 +03:00
|
|
|
import emt.network.PacketEMTKeys;
|
|
|
|
|
import emt.proxy.CommonProxy;
|
|
|
|
|
import emt.util.*;
|
2014-09-27 20:16:22 -07:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2014-07-07 16:53:03 +02:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2015-11-09 21:57:44 +03:00
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
2015-09-05 23:03:28 +03:00
|
|
|
|
2014-09-27 20:16:22 -07:00
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
|
import org.apache.logging.log4j.Logger;
|
2015-09-05 23:03:28 +03:00
|
|
|
|
2016-03-16 17:49:28 +03:00
|
|
|
@Mod(
|
|
|
|
|
modid = ModInformation.modid,
|
|
|
|
|
name = ModInformation.name,
|
|
|
|
|
version = ModInformation.version,
|
|
|
|
|
guiFactory = ModInformation.guiFactory,
|
|
|
|
|
dependencies = ModInformation.depend)
|
2014-09-27 22:54:43 +02:00
|
|
|
public class ElectroMagicTools {
|
2014-03-29 12:13:50 +01:00
|
|
|
|
2016-03-16 17:49:28 +03:00
|
|
|
@SidedProxy(
|
|
|
|
|
clientSide = ModInformation.clientProxy,
|
|
|
|
|
serverSide = ModInformation.commonProxy)
|
2015-12-06 19:47:41 +03:00
|
|
|
public static CommonProxy proxy;
|
2015-12-14 21:29:29 +03:00
|
|
|
public static CreativeTabs tabEMT = new EMTCreativeTab(ModInformation.modid + ".creativeTab");
|
2015-12-06 19:47:41 +03:00
|
|
|
public static Logger logger = LogManager.getLogger(ModInformation.name);
|
2016-03-18 18:56:45 +03:00
|
|
|
public static SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(ModInformation.channel);
|
2015-12-06 19:47:41 +03:00
|
|
|
|
|
|
|
|
@Instance(ModInformation.modid)
|
|
|
|
|
public static ElectroMagicTools instance;
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Starting planning the world domination");
|
2015-12-14 21:29:29 +03:00
|
|
|
EMTConfigHandler.init(event.getSuggestedConfigurationFile());
|
2015-12-06 19:47:41 +03:00
|
|
|
FMLCommonHandler.instance().bus().register(new EMTEventHandler());
|
2016-03-24 11:47:16 +03:00
|
|
|
FMLCommonHandler.instance().bus().register(new EMTClientEventHandler());
|
2015-12-06 19:47:41 +03:00
|
|
|
Registry.register();
|
2015-12-14 21:29:29 +03:00
|
|
|
EMTEssentiasOutputs.addPrimalOutputs();
|
|
|
|
|
EMTEssentiasOutputs.addOutputs();
|
2015-12-06 19:47:41 +03:00
|
|
|
registerPackets();
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Planning complete");
|
2015-12-06 19:47:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void load(FMLInitializationEvent event) {
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Gathering allies");
|
|
|
|
|
logger.info("Loading the proxies");
|
2015-12-06 19:47:41 +03:00
|
|
|
proxy.load();
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Making mobs drop additional items");
|
2015-12-06 19:47:41 +03:00
|
|
|
MinecraftForge.EVENT_BUS.register(new EMTEventHandler());
|
2016-03-24 11:47:16 +03:00
|
|
|
MinecraftForge.EVENT_BUS.register(new EMTClientEventHandler());
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Adding dungeon loot");
|
2015-12-14 21:29:29 +03:00
|
|
|
EMTDungeonChestGenerator.generateLoot();
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Registering entities");
|
|
|
|
|
EMTEntities.registerEMTEntities();
|
|
|
|
|
logger.info("Registering the GUI Handler");
|
2015-12-06 19:47:41 +03:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Allies gathered.");
|
2015-12-06 19:47:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void postInit(FMLPostInitializationEvent event) {
|
2016-03-17 18:25:51 +03:00
|
|
|
logger.info("Starting the world takeover");
|
2015-12-06 19:47:41 +03:00
|
|
|
Registry.registerLate();
|
2016-03-17 18:25:51 +03:00
|
|
|
EMTResearches.register();
|
|
|
|
|
logger.info("World takeover complete. Enjoy!");
|
2015-12-06 19:47:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
|
public void onFMLServerStart(FMLServerStartingEvent event) {
|
|
|
|
|
event.registerServerCommand(new CommandOutputs());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void registerPackets() {
|
|
|
|
|
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
|
|
|
|
|
}
|
2014-03-29 12:13:50 +01:00
|
|
|
}
|