equivalent-exchange-3/src/main/java/com/pahimar/ee3/EquivalentExchange3.java

120 lines
3.4 KiB
Java
Raw Normal View History

2013-09-11 14:20:15 +02:00
package com.pahimar.ee3;
import com.pahimar.ee3.configuration.ConfigurationHandler;
import com.pahimar.ee3.exchange.EnergyValueRegistry;
import com.pahimar.ee3.handler.CraftingHandler;
import com.pahimar.ee3.handler.FuelHandler;
import com.pahimar.ee3.handler.GuiHandler;
import com.pahimar.ee3.init.EnergyValues;
import com.pahimar.ee3.init.ModBlocks;
import com.pahimar.ee3.init.ModItems;
import com.pahimar.ee3.init.Recipes;
2014-04-29 03:24:31 +02:00
import com.pahimar.ee3.network.PacketHandler;
2013-12-21 23:16:55 +01:00
import com.pahimar.ee3.proxy.IProxy;
import com.pahimar.ee3.recipe.RecipeRegistry;
import com.pahimar.ee3.reference.Messages;
import com.pahimar.ee3.reference.Reference;
import com.pahimar.ee3.skill.SkillRegistry;
import com.pahimar.ee3.util.LogHelper;
2013-09-11 14:20:15 +02: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.*;
2013-09-11 14:20:15 +02:00
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import java.io.File;
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, certificateFingerprint = Reference.FINGERPRINT, version = Reference.VERSION)
public class EquivalentExchange3
{
@Instance(Reference.MOD_ID)
2013-09-11 14:20:15 +02:00
public static EquivalentExchange3 instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
2013-12-21 23:16:55 +01:00
public static IProxy proxy;
2013-09-11 14:20:15 +02:00
@EventHandler
public void invalidFingerprint(FMLFingerprintViolationEvent event)
{
// Report (log) to the user that the version of Equivalent Exchange 3
// they are using has been changed/tampered with
if (Reference.FINGERPRINT.equals("@FINGERPRINT@"))
{
LogHelper.info(Messages.NO_FINGERPRINT_MESSAGE);
}
else
{
LogHelper.warn(Messages.INVALID_FINGERPRINT_MESSAGE);
}
2013-09-11 14:20:15 +02:00
}
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
2013-09-11 14:20:15 +02:00
}
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ConfigurationHandler.init(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.MOD_ID.toLowerCase() + File.separator);
2014-05-23 00:35:31 +02:00
PacketHandler.init();
proxy.registerKeybindings();
2013-09-11 14:20:15 +02:00
ModItems.init();
2014-04-02 04:47:08 +02:00
ModBlocks.init();
EnergyValues.init();
2013-09-11 14:20:15 +02:00
}
@EventHandler
public void init(FMLInitializationEvent event)
{
2013-09-11 14:20:15 +02:00
// Register the GUI Handler
2014-03-28 02:34:47 +01:00
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
2013-09-11 14:20:15 +02:00
// Initialize mod tile entities
proxy.registerTileEntities();
// Initialize custom rendering and pre-load textures (Client only)
proxy.initRenderingAndTextures();
// Register the Items Event Handler
2014-05-23 00:35:31 +02:00
proxy.registerEventHandlers();
2013-09-11 14:20:15 +02:00
CraftingHandler.init();
Recipes.init();
// Register our fuels
GameRegistry.registerFuelHandler(new FuelHandler());
2013-09-11 14:20:15 +02:00
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
RecipeRegistry.getInstance();
2013-09-11 14:20:15 +02:00
}
@EventHandler
public void handleIMCMessages(IMCEvent event)
{
2013-09-11 14:20:15 +02:00
}
public EnergyValueRegistry getEnergyValueRegistry()
{
return EnergyValueRegistry.getInstance();
}
public SkillRegistry getSkillRegistry()
{
return SkillRegistry.getInstance();
}
2013-09-11 14:20:15 +02:00
}