2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty;
|
|
|
|
|
2013-09-24 22:19:09 +00:00
|
|
|
import net.minecraft.crash.CallableMinecraftVersion;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
|
|
import net.minecraftforge.common.DimensionManager;
|
2013-09-25 06:58:30 +00:00
|
|
|
import net.minecraftforge.common.ForgeVersion;
|
2013-05-03 13:00:44 +00:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2013-10-18 23:57:56 +00:00
|
|
|
import biomesoplenty.configuration.BOPAchievements;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.configuration.BOPBiomes;
|
|
|
|
import biomesoplenty.configuration.BOPBlocks;
|
|
|
|
import biomesoplenty.configuration.BOPCrafting;
|
|
|
|
import biomesoplenty.configuration.BOPEntities;
|
2013-07-09 04:10:57 +00:00
|
|
|
import biomesoplenty.configuration.BOPFluids;
|
2013-07-12 02:06:14 +00:00
|
|
|
import biomesoplenty.configuration.BOPItems;
|
2013-05-25 08:57:21 +00:00
|
|
|
import biomesoplenty.configuration.BOPPotions;
|
2013-09-21 06:53:11 +00:00
|
|
|
import biomesoplenty.configuration.BOPStructures;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.configuration.BOPVanillaCompat;
|
2013-09-14 10:16:39 +00:00
|
|
|
import biomesoplenty.configuration.configfile.BOPConfiguration;
|
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationIDs;
|
|
|
|
import biomesoplenty.configuration.configfile.BOPConfigurationMisc;
|
2013-10-16 05:33:43 +00:00
|
|
|
import biomesoplenty.eventhandlers.BonemealEventHandler;
|
|
|
|
import biomesoplenty.eventhandlers.BreakSpeedEventHandler;
|
|
|
|
import biomesoplenty.eventhandlers.EntityEventHandler;
|
|
|
|
import biomesoplenty.eventhandlers.FlipperMovementEventHandler;
|
|
|
|
import biomesoplenty.eventhandlers.FluidEventHandler;
|
|
|
|
import biomesoplenty.eventhandlers.VillageMaterialEventHandler;
|
2013-06-15 11:08:58 +00:00
|
|
|
import biomesoplenty.handlers.BOPCraftHandler;
|
2013-11-13 03:48:32 +00:00
|
|
|
import biomesoplenty.handlers.BOPPickupHandler;
|
2013-06-30 10:06:31 +00:00
|
|
|
import biomesoplenty.handlers.MovementHandler;
|
2013-06-15 11:08:58 +00:00
|
|
|
import biomesoplenty.handlers.SoundHandler;
|
|
|
|
import biomesoplenty.handlers.TickHandlerClient;
|
2013-06-30 09:14:10 +00:00
|
|
|
import biomesoplenty.handlers.TickHandlerServer;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.helpers.CreativeTabsBOP;
|
2013-09-26 03:50:38 +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;
|
2013-11-05 00:26:15 +00:00
|
|
|
import biomesoplenty.world.WorldTypeBOP;
|
2013-05-07 18:08:35 +00:00
|
|
|
import biomesoplenty.world.WorldTypeSize;
|
2013-05-03 13:00:44 +00:00
|
|
|
import cpw.mods.fml.common.Mod;
|
2013-07-02 03:57:49 +00:00
|
|
|
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;
|
2013-05-10 07:12:56 +00:00
|
|
|
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-09-26 03:50:38 +00:00
|
|
|
@Mod(modid="BiomesOPlenty", name="Biomes O' Plenty", version=Version.VERSION, dependencies="after:Natura; required-after:Forge@[1.42.666.42.1,)")
|
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
|
|
|
|
2013-07-02 07:43:39 +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
|
|
|
|
2013-09-26 03:50:38 +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
|
|
|
|
2013-05-25 08:57:21 +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();
|
2013-09-24 22:19:09 +00:00
|
|
|
if ((new CallableMinecraftVersion(null)).minecraftVersion() != "1.6.2")
|
|
|
|
BOPStructures.init();
|
2013-05-03 13:00:44 +00:00
|
|
|
BOPBiomes.init();
|
|
|
|
BOPEntities.init();
|
|
|
|
BOPVanillaCompat.init();
|
2013-11-13 03:48:32 +00:00
|
|
|
|
|
|
|
GameRegistry.registerCraftingHandler(new BOPCraftHandler());
|
|
|
|
GameRegistry.registerPickupHandler(new BOPPickupHandler());
|
2013-05-06 07:11:55 +00:00
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
// Achievement declaration
|
2013-09-14 10:16:39 +00:00
|
|
|
if (BOPConfigurationMisc.achievements)
|
2013-05-06 07:11:55 +00:00
|
|
|
{
|
2013-10-18 23:57:56 +00:00
|
|
|
BOPAchievements.init();
|
2013-05-06 07:11:55 +00:00
|
|
|
}
|
2013-06-16 00:30:58 +00:00
|
|
|
|
2013-07-04 03:18:48 +00:00
|
|
|
if (proxy instanceof ClientProxy)
|
|
|
|
{
|
|
|
|
MinecraftForge.EVENT_BUS.register(new SoundHandler());
|
|
|
|
}
|
2013-06-21 05:36:29 +00:00
|
|
|
|
|
|
|
BOPCrossIntegration.preInit();
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
|
2013-07-02 07:43:39 +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());
|
2013-09-25 06:58:30 +00:00
|
|
|
if (ForgeVersion.buildVersion >= 891 || proxy instanceof ClientProxy)
|
|
|
|
MinecraftForge.TERRAIN_GEN_BUS.register(new VillageMaterialEventHandler());
|
2013-10-18 23:57:56 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new BOPAchievements());
|
2013-10-16 05:33:43 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new BonemealEventHandler());
|
2013-06-15 11:08:58 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
|
2013-07-09 05:14:10 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new FluidEventHandler());
|
2013-10-16 05:33:43 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new BreakSpeedEventHandler());
|
2013-06-30 10:06:31 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new MovementHandler());
|
2013-09-14 03:01:18 +00:00
|
|
|
MinecraftForge.EVENT_BUS.register(new FlipperMovementEventHandler());
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
proxy.registerRenderers();
|
|
|
|
|
2013-08-10 10:42:36 +00:00
|
|
|
// if (BOPConfiguration.TerrainGen.netherOverride)
|
|
|
|
// {
|
|
|
|
// DimensionManager.unregisterProviderType(-1);
|
|
|
|
// DimensionManager.registerProviderType(-1, WorldProviderBOPhell.class, true);
|
|
|
|
// }
|
2013-09-14 10:16:39 +00:00
|
|
|
DimensionManager.registerProviderType(BOPConfigurationIDs.promisedLandDimID, WorldProviderPromised.class, false);
|
|
|
|
DimensionManager.registerDimension(BOPConfigurationIDs.promisedLandDimID, BOPConfigurationIDs.promisedLandDimID);
|
2013-06-04 20:21:06 +00:00
|
|
|
|
|
|
|
BOPCrossIntegration.init();
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
2013-05-06 07:11:55 +00:00
|
|
|
|
2013-07-02 07:43:39 +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-11-05 00:26:15 +00:00
|
|
|
|
|
|
|
//Initialize new world type
|
|
|
|
BOPBiomes.WTBiomesOP = new WorldTypeBOP();
|
2013-06-14 13:17:48 +00:00
|
|
|
|
|
|
|
TickRegistry.registerTickHandler(new TickHandlerClient(), Side.CLIENT);
|
2013-06-30 09:14:10 +00:00
|
|
|
TickRegistry.registerTickHandler(new TickHandlerServer(), Side.SERVER);
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
}
|