2015-08-29 14:33:25 +02:00
|
|
|
/*
|
|
|
|
* This file ("ActuallyAdditions.java") is part of the Actually Additions Mod for Minecraft.
|
|
|
|
* It is created and owned by Ellpeck and distributed
|
|
|
|
* under the Actually Additions License to be found at
|
|
|
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
|
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
|
|
*
|
2015-11-02 20:55:19 +01:00
|
|
|
* © 2015 Ellpeck
|
2015-08-29 14:33:25 +02:00
|
|
|
*/
|
|
|
|
|
2015-12-30 22:02:15 +01:00
|
|
|
package de.ellpeck.actuallyadditions;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2015-02-17 16:15:16 +01:00
|
|
|
import cpw.mods.fml.common.Mod;
|
2015-02-20 22:45:33 +01:00
|
|
|
import cpw.mods.fml.common.Mod.EventHandler;
|
|
|
|
import cpw.mods.fml.common.Mod.Instance;
|
2015-02-17 16:15:16 +01:00
|
|
|
import cpw.mods.fml.common.SidedProxy;
|
2015-06-29 20:55:56 +02:00
|
|
|
import cpw.mods.fml.common.event.*;
|
2015-12-30 22:02:15 +01:00
|
|
|
import de.ellpeck.actuallyadditions.achievement.InitAchievements;
|
|
|
|
import de.ellpeck.actuallyadditions.blocks.InitBlocks;
|
|
|
|
import de.ellpeck.actuallyadditions.booklet.InitBooklet;
|
|
|
|
import de.ellpeck.actuallyadditions.config.ConfigurationHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.crafting.CrusherCrafting;
|
|
|
|
import de.ellpeck.actuallyadditions.crafting.InitCrafting;
|
|
|
|
import de.ellpeck.actuallyadditions.crafting.ItemCrafting;
|
|
|
|
import de.ellpeck.actuallyadditions.event.InitEvents;
|
|
|
|
import de.ellpeck.actuallyadditions.gen.InitVillager;
|
|
|
|
import de.ellpeck.actuallyadditions.gen.OreGen;
|
|
|
|
import de.ellpeck.actuallyadditions.inventory.GuiHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.items.InitForeignPaxels;
|
|
|
|
import de.ellpeck.actuallyadditions.items.InitItems;
|
|
|
|
import de.ellpeck.actuallyadditions.items.ItemCoffee;
|
|
|
|
import de.ellpeck.actuallyadditions.items.lens.LensNoneRecipeHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.material.InitArmorMaterials;
|
|
|
|
import de.ellpeck.actuallyadditions.material.InitToolMaterials;
|
|
|
|
import de.ellpeck.actuallyadditions.misc.*;
|
|
|
|
import de.ellpeck.actuallyadditions.network.PacketHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.ore.InitOreDict;
|
|
|
|
import de.ellpeck.actuallyadditions.proxy.IProxy;
|
|
|
|
import de.ellpeck.actuallyadditions.recipe.FuelHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.recipe.HairyBallHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.recipe.TreasureChestHandler;
|
|
|
|
import de.ellpeck.actuallyadditions.tile.TileEntityBase;
|
|
|
|
import de.ellpeck.actuallyadditions.update.UpdateChecker;
|
|
|
|
import de.ellpeck.actuallyadditions.util.FakePlayerUtil;
|
|
|
|
import de.ellpeck.actuallyadditions.util.ModUtil;
|
|
|
|
import de.ellpeck.actuallyadditions.util.Util;
|
2015-10-12 04:30:14 +02:00
|
|
|
import net.minecraft.init.Items;
|
2015-11-11 22:03:25 +01:00
|
|
|
import net.minecraft.server.MinecraftServer;
|
2015-10-02 16:48:01 +02:00
|
|
|
|
2015-12-28 19:01:36 +01:00
|
|
|
import java.util.Locale;
|
|
|
|
|
2015-08-03 09:01:13 +02:00
|
|
|
// So that BuildCraft Oil always gets used
|
2015-12-30 22:02:15 +01:00
|
|
|
@Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, dependencies = "after:BuildCraft|Energy", guiFactory = "GuiFactory")
|
2015-03-07 12:51:28 +01:00
|
|
|
public class ActuallyAdditions{
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2015-03-29 15:29:05 +02:00
|
|
|
@Instance(ModUtil.MOD_ID)
|
2015-03-07 12:51:28 +01:00
|
|
|
public static ActuallyAdditions instance;
|
2014-11-10 16:47:04 +01:00
|
|
|
|
2015-12-30 22:02:15 +01:00
|
|
|
@SidedProxy(clientSide = "ClientProxy", serverSide = "ServerProxy")
|
2014-12-03 21:55:53 +01:00
|
|
|
public static IProxy proxy;
|
|
|
|
|
2015-06-21 02:28:49 +02:00
|
|
|
@EventHandler
|
2014-11-10 16:47:04 +01:00
|
|
|
public void preInit(FMLPreInitializationEvent event){
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Starting PreInitialization Phase...");
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-17 11:17:55 +02:00
|
|
|
new ConfigurationHandler(event.getSuggestedConfigurationFile());
|
2015-06-12 19:12:06 +02:00
|
|
|
PacketHandler.init();
|
2015-07-11 05:24:04 +02:00
|
|
|
InitToolMaterials.init();
|
|
|
|
InitArmorMaterials.init();
|
2014-11-10 16:47:04 +01:00
|
|
|
InitBlocks.init();
|
|
|
|
InitItems.init();
|
2015-05-20 22:39:43 +02:00
|
|
|
FuelHandler.init();
|
2015-11-02 21:38:49 +01:00
|
|
|
UpdateChecker.init();
|
2015-08-30 19:10:10 +02:00
|
|
|
proxy.preInit(event);
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("PreInitialization Finished.");
|
2014-11-10 16:47:04 +01:00
|
|
|
}
|
|
|
|
|
2015-06-21 02:28:49 +02:00
|
|
|
@EventHandler
|
2014-11-10 16:47:04 +01:00
|
|
|
public void init(FMLInitializationEvent event){
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Starting Initialization Phase...");
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-02 10:45:15 +02:00
|
|
|
InitOreDict.init();
|
2015-02-09 17:25:05 +01:00
|
|
|
InitAchievements.init();
|
2014-12-18 19:24:06 +01:00
|
|
|
GuiHandler.init();
|
|
|
|
OreGen.init();
|
|
|
|
TileEntityBase.init();
|
2015-03-07 02:23:31 +01:00
|
|
|
InitEvents.init();
|
|
|
|
InitCrafting.init();
|
2015-11-15 19:24:36 +01:00
|
|
|
DungeonLoot.init();
|
2015-08-30 19:10:10 +02:00
|
|
|
proxy.init(event);
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Initialization Finished.");
|
2014-11-10 16:47:04 +01:00
|
|
|
}
|
|
|
|
|
2015-06-21 02:28:49 +02:00
|
|
|
@EventHandler
|
2014-11-10 16:47:04 +01:00
|
|
|
public void postInit(FMLPostInitializationEvent event){
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("Starting PostInitialization Phase...");
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-11-08 19:45:34 +01:00
|
|
|
InitVillager.init();
|
2015-06-12 21:29:21 +02:00
|
|
|
ItemCoffee.initIngredients();
|
2015-07-01 16:06:40 +02:00
|
|
|
CrusherCrafting.init();
|
2015-06-21 02:28:49 +02:00
|
|
|
ItemCrafting.initMashedFoodRecipes();
|
2015-06-28 03:12:32 +02:00
|
|
|
HairyBallHandler.init();
|
2015-07-10 13:08:20 +02:00
|
|
|
TreasureChestHandler.init();
|
2015-12-03 22:49:31 +01:00
|
|
|
LensNoneRecipeHandler.init();
|
2015-07-12 22:05:34 +02:00
|
|
|
InitForeignPaxels.init();
|
2015-11-27 06:59:02 +01:00
|
|
|
|
|
|
|
InitBooklet.init();
|
2015-08-30 19:10:10 +02:00
|
|
|
proxy.postInit(event);
|
2015-02-09 17:25:05 +01:00
|
|
|
|
2015-07-01 21:32:48 +02:00
|
|
|
ModUtil.LOGGER.info("PostInitialization Finished.");
|
2015-12-16 14:59:03 +01:00
|
|
|
FakePlayerUtil.info();
|
2014-11-10 16:47:04 +01:00
|
|
|
}
|
2015-06-28 03:12:32 +02:00
|
|
|
|
2015-06-29 20:55:56 +02:00
|
|
|
@EventHandler
|
|
|
|
public void serverStarting(FMLServerStartingEvent event){
|
2015-07-01 21:32:48 +02:00
|
|
|
Util.registerDispenserHandler(InitItems.itemBucketOil, new DispenserHandlerEmptyBucket());
|
|
|
|
Util.registerDispenserHandler(InitItems.itemBucketCanolaOil, new DispenserHandlerEmptyBucket());
|
2015-10-12 04:30:14 +02:00
|
|
|
Util.registerDispenserHandler(Items.bucket, new DispenserHandlerFillBucket());
|
2015-07-01 21:32:48 +02:00
|
|
|
Util.registerDispenserHandler(InitItems.itemFertilizer, new DispenserHandlerFertilize());
|
2015-11-11 22:03:25 +01:00
|
|
|
}
|
2015-10-19 17:50:43 +02:00
|
|
|
|
2015-11-11 22:03:25 +01:00
|
|
|
@EventHandler
|
|
|
|
public void serverStarted(FMLServerStartedEvent event){
|
2015-11-12 20:06:58 +01:00
|
|
|
if(LaserRelayConnectionHandler.getInstance() == null){
|
|
|
|
LaserRelayConnectionHandler.setInstance(new LaserRelayConnectionHandler());
|
|
|
|
}
|
|
|
|
|
2015-11-11 22:03:25 +01:00
|
|
|
WorldData.init(MinecraftServer.getServer());
|
2015-06-29 20:55:56 +02:00
|
|
|
}
|
2015-12-17 22:05:42 +01:00
|
|
|
|
|
|
|
@EventHandler
|
|
|
|
public void missingMapping(FMLMissingMappingsEvent event){
|
|
|
|
for(FMLMissingMappingsEvent.MissingMapping mapping : event.get()){
|
|
|
|
//Ignore removal of foreign paxels
|
2015-12-28 19:01:36 +01:00
|
|
|
if(mapping.name != null && mapping.name.toLowerCase(Locale.ROOT).startsWith(ModUtil.MOD_ID_LOWER+":")){
|
2015-12-28 15:07:21 +01:00
|
|
|
if(mapping.name.contains("paxel") || mapping.name.contains("itemSpecial")){
|
|
|
|
mapping.ignore();
|
2015-12-28 19:01:36 +01:00
|
|
|
ModUtil.LOGGER.info("Missing Mapping "+mapping.name+" is getting ignored. This is intentional.");
|
2015-12-28 15:07:21 +01:00
|
|
|
}
|
2015-12-17 22:05:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-11-10 16:47:04 +01:00
|
|
|
}
|