2012-08-20 03:16:51 +02:00
|
|
|
package ee3.common;
|
|
|
|
|
2012-08-24 21:58:05 +02:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2012-09-25 21:01:39 +02:00
|
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
2012-08-20 03:16:51 +02:00
|
|
|
import cpw.mods.fml.common.Mod;
|
|
|
|
import cpw.mods.fml.common.Mod.Init;
|
|
|
|
import cpw.mods.fml.common.Mod.Instance;
|
|
|
|
import cpw.mods.fml.common.Mod.PostInit;
|
|
|
|
import cpw.mods.fml.common.Mod.PreInit;
|
2012-09-25 21:01:39 +02:00
|
|
|
import cpw.mods.fml.common.Side;
|
2012-08-21 05:18:53 +02:00
|
|
|
import cpw.mods.fml.common.SidedProxy;
|
2012-08-20 03:16:51 +02:00
|
|
|
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.network.NetworkMod;
|
2012-08-25 08:07:59 +02:00
|
|
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
|
|
|
import cpw.mods.fml.common.registry.GameRegistry;
|
2012-09-25 21:01:39 +02:00
|
|
|
import cpw.mods.fml.common.registry.TickRegistry;
|
2012-08-29 22:02:30 +02:00
|
|
|
import ee3.common.block.ModBlocks;
|
2012-08-21 05:18:53 +02:00
|
|
|
import ee3.common.core.CommonProxy;
|
2012-09-07 21:41:43 +02:00
|
|
|
import ee3.common.core.RecipesTransmutationStone;
|
2012-08-24 21:38:19 +02:00
|
|
|
import ee3.common.core.handlers.AddonHandler;
|
2012-08-21 05:18:53 +02:00
|
|
|
import ee3.common.core.handlers.ConfigurationHandler;
|
2012-08-24 21:58:05 +02:00
|
|
|
import ee3.common.core.handlers.EntityLivingHandler;
|
2012-08-25 08:07:59 +02:00
|
|
|
import ee3.common.core.handlers.ItemPickupHandler;
|
2012-09-26 20:02:35 +02:00
|
|
|
import ee3.common.core.handlers.LocalizationHandler;
|
2012-09-21 22:13:21 +02:00
|
|
|
import ee3.common.core.handlers.PacketHandler;
|
2012-09-07 22:18:11 +02:00
|
|
|
import ee3.common.core.handlers.PlayerDestroyItemHandler;
|
2012-09-25 21:01:39 +02:00
|
|
|
import ee3.common.core.handlers.VersionCheckTickHandler;
|
|
|
|
import ee3.common.core.helper.VersionHelper;
|
2012-08-25 08:07:59 +02:00
|
|
|
import ee3.common.item.ModItems;
|
2012-08-20 03:16:51 +02:00
|
|
|
import ee3.common.lib.Reference;
|
|
|
|
|
2012-08-24 21:38:19 +02:00
|
|
|
/**
|
2012-08-25 08:46:51 +02:00
|
|
|
* EquivalentExchange3
|
|
|
|
*
|
|
|
|
* Main mod class for the Minecraft mod Equivalent Exchange 3
|
|
|
|
*
|
|
|
|
* @author pahimar
|
|
|
|
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
|
|
|
*
|
|
|
|
*/
|
2012-08-20 03:16:51 +02:00
|
|
|
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
|
|
|
|
@NetworkMod(channels = { Reference.CHANNEL_NAME }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
|
|
|
public class EquivalentExchange3 {
|
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
@Instance
|
|
|
|
public static EquivalentExchange3 instance;
|
|
|
|
|
|
|
|
@SidedProxy(clientSide = "ee3.client.core.ClientProxy", serverSide = "ee3.common.core.CommonProxy")
|
|
|
|
public static CommonProxy proxy;
|
|
|
|
|
|
|
|
@PreInit
|
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
|
|
|
|
2012-09-30 03:48:44 +02:00
|
|
|
// Load the localization files into the LanguageRegistry
|
|
|
|
LocalizationHandler.loadLanguages();
|
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
// Initialize the configuration
|
|
|
|
ConfigurationHandler.init(event.getSuggestedConfigurationFile());
|
2012-09-26 20:28:23 +02:00
|
|
|
|
|
|
|
// Conduct the version check and log the result
|
2012-09-25 21:01:39 +02:00
|
|
|
VersionHelper.checkVersion();
|
2012-09-26 20:28:23 +02:00
|
|
|
VersionHelper.logResult();
|
2012-09-25 21:01:39 +02:00
|
|
|
|
|
|
|
// Initialize the Version Check Tick Handler (Client only)
|
|
|
|
TickRegistry.registerTickHandler(new VersionCheckTickHandler(), Side.CLIENT);
|
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
// Register the KeyBinding Handler (Client only)
|
|
|
|
proxy.registerKeyBindingHandler();
|
|
|
|
|
|
|
|
// Register the Sound Handler (Client only)
|
|
|
|
proxy.registerSoundHandler();
|
2012-09-25 21:01:39 +02:00
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Init
|
|
|
|
public void load(FMLInitializationEvent event) {
|
2012-09-25 21:01:39 +02:00
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
// Initialize the custom item rarity types
|
|
|
|
proxy.initCustomRarityTypes();
|
|
|
|
|
|
|
|
// Register the GUI Handler
|
|
|
|
NetworkRegistry.instance().registerGuiHandler(instance, proxy);
|
|
|
|
|
2012-09-07 22:18:11 +02:00
|
|
|
// Register the PlayerDestroyItem Handler
|
|
|
|
MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler());
|
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
// Register the Item Pickup Handler
|
|
|
|
MinecraftForge.EVENT_BUS.register(new ItemPickupHandler());
|
|
|
|
|
|
|
|
// Register the EntityLiving Handler
|
|
|
|
MinecraftForge.EVENT_BUS.register(new EntityLivingHandler());
|
|
|
|
|
2012-08-29 22:02:30 +02:00
|
|
|
// Initialize mod blocks
|
|
|
|
ModBlocks.init();
|
|
|
|
|
2012-08-25 08:46:51 +02:00
|
|
|
// Initialize mod items
|
|
|
|
ModItems.init();
|
2012-08-29 22:02:30 +02:00
|
|
|
|
|
|
|
// Initialize mod tile entities
|
|
|
|
proxy.initTileEntities();
|
2012-09-07 21:41:43 +02:00
|
|
|
|
2012-09-11 04:07:59 +02:00
|
|
|
// Initialize custom rendering and pre-load textures (Client only)
|
|
|
|
proxy.initRenderingAndTextures();
|
|
|
|
|
2012-09-07 21:41:43 +02:00
|
|
|
// Load the Transmutation Stone recipes
|
|
|
|
RecipesTransmutationStone.init();
|
2012-08-25 08:46:51 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostInit
|
|
|
|
public void modsLoaded(FMLPostInitializationEvent event) {
|
|
|
|
|
|
|
|
// Initialize the Addon Handler
|
2012-09-25 21:01:39 +02:00
|
|
|
AddonHandler.init();
|
2012-08-25 08:46:51 +02:00
|
|
|
|
|
|
|
}
|
2012-08-20 03:16:51 +02:00
|
|
|
}
|