BiomesOPlenty/common/biomesoplenty/BiomesOPlenty.java

132 lines
4.6 KiB
Java
Raw Normal View History

2013-05-03 13:00:44 +00:00
package biomesoplenty;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import biomesoplenty.configuration.BOPBiomes;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.configuration.BOPCrafting;
import biomesoplenty.configuration.BOPEntities;
2013-07-09 04:10:57 +00:00
import biomesoplenty.configuration.BOPFluids;
import biomesoplenty.configuration.BOPItems;
import biomesoplenty.configuration.BOPPotions;
2013-05-03 13:00:44 +00:00
import biomesoplenty.configuration.BOPVanillaCompat;
2013-06-15 11:08:58 +00:00
import biomesoplenty.handlers.BOPCraftHandler;
import biomesoplenty.handlers.BonemealHandler;
import biomesoplenty.handlers.BreakSpeedHandler;
2013-06-15 11:08:58 +00:00
import biomesoplenty.handlers.EntityEventHandler;
2013-09-14 03:01:18 +00:00
import biomesoplenty.handlers.FlipperMovementEventHandler;
import biomesoplenty.handlers.FluidEventHandler;
import biomesoplenty.handlers.MovementHandler;
2013-06-15 11:08:58 +00:00
import biomesoplenty.handlers.SoundHandler;
import biomesoplenty.handlers.TickHandlerClient;
import biomesoplenty.handlers.TickHandlerServer;
2013-05-03 13:00:44 +00:00
import biomesoplenty.helpers.AchievementHelper;
import biomesoplenty.helpers.CreativeTabsBOP;
2013-06-09 00:39:12 +00:00
import biomesoplenty.helpers.Localizations;
2013-06-14 13:17:48 +00:00
import biomesoplenty.helpers.Version;
2013-05-03 13:00:44 +00:00
import biomesoplenty.integration.BOPCrossIntegration;
2013-05-07 18:08:35 +00:00
import biomesoplenty.world.WorldProviderPromised;
import biomesoplenty.world.WorldTypeSize;
2013-05-03 13:00:44 +00:00
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
2013-05-03 13:00:44 +00:00
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;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
2013-06-14 13:17:48 +00:00
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
2013-05-03 13:00:44 +00:00
2013-06-14 13:17:48 +00:00
@Mod(modid="BiomesOPlenty", name="Biomes O' Plenty", version=Version.VERSION, dependencies="after:Natura")
2013-05-03 13:00:44 +00:00
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class BiomesOPlenty
2013-05-31 10:34:02 +00:00
{
2013-05-03 13:00:44 +00:00
@Instance("BiomesOPlenty")
public static BiomesOPlenty instance;
@SidedProxy(clientSide="biomesoplenty.ClientProxy", serverSide="biomesoplenty.CommonProxy")
public static CommonProxy proxy;
public static CreativeTabs tabBiomesOPlenty;
2013-08-03 00:07:43 +00:00
public static String configPath;
2013-05-03 13:00:44 +00:00
@EventHandler
2013-05-03 13:00:44 +00:00
public void preInit(FMLPreInitializationEvent event)
{
2013-08-03 00:07:43 +00:00
configPath = event.getModConfigurationDirectory() + "/biomesoplenty/";
BOPConfiguration.init(configPath);
2013-06-14 13:17:48 +00:00
Version.check();
2013-05-31 10:34:02 +00:00
2013-05-03 13:00:44 +00:00
tabBiomesOPlenty = new CreativeTabsBOP(CreativeTabs.getNextID(),"tabBiomesOPlenty");
2013-05-31 10:34:02 +00:00
BOPPotions.init();
2013-05-03 13:00:44 +00:00
BOPBlocks.init();
BOPItems.init();
2013-07-09 04:10:57 +00:00
BOPFluids.init();
2013-05-03 13:00:44 +00:00
BOPCrafting.init();
BOPBiomes.init();
BOPEntities.init();
BOPVanillaCompat.init();
2013-06-09 00:39:12 +00:00
2013-07-04 03:18:48 +00:00
if (proxy instanceof ClientProxy)
{
Localizations.loadLanguages();
}
2013-05-03 13:00:44 +00:00
// Achievement declaration
2013-08-03 00:07:43 +00:00
if (BOPConfiguration.Misc.achievements)
{
AchievementHelper.init();
}
2013-05-31 10:34:02 +00:00
2013-06-15 11:08:58 +00:00
GameRegistry.registerCraftingHandler(new BOPCraftHandler());
2013-07-04 03:18:48 +00:00
if (proxy instanceof ClientProxy)
{
MinecraftForge.EVENT_BUS.register(new SoundHandler());
}
BOPCrossIntegration.preInit();
2013-05-03 13:00:44 +00:00
}
@EventHandler
2013-05-03 13:00:44 +00:00
public void load(FMLInitializationEvent event)
{
// Add helpers for compatibility
MinecraftForge.TERRAIN_GEN_BUS.register(new WorldTypeSize());
MinecraftForge.EVENT_BUS.register(new AchievementHelper());
2013-06-15 11:08:58 +00:00
MinecraftForge.EVENT_BUS.register(new BonemealHandler());
MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
2013-07-09 05:14:10 +00:00
MinecraftForge.EVENT_BUS.register(new FluidEventHandler());
MinecraftForge.EVENT_BUS.register(new BreakSpeedHandler());
MinecraftForge.EVENT_BUS.register(new MovementHandler());
2013-09-14 03:01:18 +00:00
MinecraftForge.EVENT_BUS.register(new FlipperMovementEventHandler());
//MinecraftForge.EVENT_BUS.register(new AxeChopHandler());
2013-05-03 13:00:44 +00:00
proxy.registerRenderers();
// if (BOPConfiguration.TerrainGen.netherOverride)
// {
// DimensionManager.unregisterProviderType(-1);
// DimensionManager.registerProviderType(-1, WorldProviderBOPhell.class, true);
// }
2013-08-03 00:07:43 +00:00
DimensionManager.registerProviderType(BOPConfiguration.IDs.promisedLandDimID, WorldProviderPromised.class, false);
DimensionManager.registerDimension(BOPConfiguration.IDs.promisedLandDimID, BOPConfiguration.IDs.promisedLandDimID);
2013-06-04 20:21:06 +00:00
BOPCrossIntegration.init();
2013-05-03 13:00:44 +00:00
}
@EventHandler
2013-05-03 13:00:44 +00:00
public void postInit(FMLPostInitializationEvent event)
{
2013-06-04 20:21:06 +00:00
BOPCrossIntegration.postInit();
2013-06-14 13:17:48 +00:00
TickRegistry.registerTickHandler(new TickHandlerClient(), Side.CLIENT);
TickRegistry.registerTickHandler(new TickHandlerServer(), Side.SERVER);
2013-05-03 13:00:44 +00:00
}
}