mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-16 13:03:12 +01:00
166 lines
6.5 KiB
Java
166 lines
6.5 KiB
Java
/*
|
|
* 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://ellpeck.de/actaddlicense
|
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
|
*
|
|
* © 2015-2016 Ellpeck
|
|
*/
|
|
|
|
package de.ellpeck.actuallyadditions.mod;
|
|
|
|
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
|
|
import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements;
|
|
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
|
|
import de.ellpeck.actuallyadditions.mod.booklet.InitBooklet;
|
|
import de.ellpeck.actuallyadditions.mod.config.ConfigurationHandler;
|
|
import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting;
|
|
import de.ellpeck.actuallyadditions.mod.crafting.InitCrafting;
|
|
import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting;
|
|
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
|
|
import de.ellpeck.actuallyadditions.mod.event.CommonEvents;
|
|
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
|
import de.ellpeck.actuallyadditions.mod.gen.OreGen;
|
|
import de.ellpeck.actuallyadditions.mod.gen.village.InitVillager;
|
|
import de.ellpeck.actuallyadditions.mod.inventory.GuiHandler;
|
|
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
|
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensMining;
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.LensRecipeHandler;
|
|
import de.ellpeck.actuallyadditions.mod.items.lens.Lenses;
|
|
import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials;
|
|
import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials;
|
|
import de.ellpeck.actuallyadditions.mod.misc.BannerHelper;
|
|
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler;
|
|
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.MethodHandler;
|
|
import de.ellpeck.actuallyadditions.mod.misc.SoundHandler;
|
|
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.DefaultFarmerBehavior;
|
|
import de.ellpeck.actuallyadditions.mod.network.PacketHandler;
|
|
import de.ellpeck.actuallyadditions.mod.ore.InitOreDict;
|
|
import de.ellpeck.actuallyadditions.mod.proxy.IProxy;
|
|
import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler;
|
|
import de.ellpeck.actuallyadditions.mod.recipe.FuelHandler;
|
|
import de.ellpeck.actuallyadditions.mod.recipe.HairyBallHandler;
|
|
import de.ellpeck.actuallyadditions.mod.recipe.TreasureChestHandler;
|
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
|
|
import de.ellpeck.actuallyadditions.mod.update.UpdateChecker;
|
|
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
|
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
|
import net.minecraftforge.fml.common.Loader;
|
|
import net.minecraftforge.fml.common.Mod;
|
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
|
import net.minecraftforge.fml.common.Mod.Instance;
|
|
import net.minecraftforge.fml.common.SidedProxy;
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent;
|
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
// So that BuildCraft Oil always gets used
|
|
@Mod(modid = ModUtil.MOD_ID, name = ModUtil.NAME, version = ModUtil.VERSION, dependencies = "after:BuildCraft|Energy", guiFactory = "de.ellpeck.actuallyadditions.mod.config.GuiFactory")
|
|
public class ActuallyAdditions{
|
|
|
|
@Instance(ModUtil.MOD_ID)
|
|
public static ActuallyAdditions instance;
|
|
|
|
@SidedProxy(clientSide = ModUtil.PROXY_CLIENT, serverSide = ModUtil.PROXY_SERVER)
|
|
public static IProxy proxy;
|
|
|
|
public static boolean teslaLoaded;
|
|
|
|
static{
|
|
//For some reason, this has to be done here
|
|
FluidRegistry.enableUniversalBucket();
|
|
}
|
|
|
|
@EventHandler
|
|
public void preInit(FMLPreInitializationEvent event){
|
|
ModUtil.LOGGER.info("Starting PreInitialization Phase...");
|
|
|
|
ActuallyAdditionsAPI.methodHandler = new MethodHandler();
|
|
ActuallyAdditionsAPI.connectionHandler = new LaserRelayConnectionHandler();
|
|
Lenses.init();
|
|
InitBooklet.preInit();
|
|
|
|
if(Loader.isModLoaded("tesla")){
|
|
ModUtil.LOGGER.info("Tesla loaded... Activating Tesla Power System integration...");
|
|
teslaLoaded = true;
|
|
}
|
|
else{
|
|
ModUtil.LOGGER.info("Tesla not found! Skipping Tesla Power System integration.");
|
|
}
|
|
|
|
new ConfigurationHandler(event.getSuggestedConfigurationFile());
|
|
PacketHandler.init();
|
|
InitToolMaterials.init();
|
|
InitArmorMaterials.init();
|
|
InitBlocks.init();
|
|
InitFluids.init();
|
|
InitItems.init();
|
|
FuelHandler.init();
|
|
BannerHelper.init();
|
|
SoundHandler.init();
|
|
new UpdateChecker();
|
|
proxy.preInit(event);
|
|
|
|
ModUtil.LOGGER.info("PreInitialization Finished.");
|
|
}
|
|
|
|
@EventHandler
|
|
public void init(FMLInitializationEvent event){
|
|
ModUtil.LOGGER.info("Starting Initialization Phase...");
|
|
|
|
InitOreDict.init();
|
|
InitAchievements.init();
|
|
GuiHandler.init();
|
|
new OreGen();
|
|
TileEntityBase.init();
|
|
new CommonEvents();
|
|
InitCrafting.init();
|
|
InitEntities.init();
|
|
|
|
proxy.init(event);
|
|
|
|
ModUtil.LOGGER.info("Initialization Finished.");
|
|
}
|
|
|
|
@EventHandler
|
|
public void postInit(FMLPostInitializationEvent event){
|
|
ModUtil.LOGGER.info("Starting PostInitialization Phase...");
|
|
|
|
InitVillager.init();
|
|
ItemCoffee.initIngredients();
|
|
CrusherCrafting.init();
|
|
ItemCrafting.initMashedFoodRecipes();
|
|
HairyBallHandler.init();
|
|
TreasureChestHandler.init();
|
|
LensRecipeHandler.init();
|
|
EmpowererHandler.init();
|
|
LensMining.init();
|
|
|
|
InitBooklet.postInit();
|
|
proxy.postInit(event);
|
|
|
|
ModUtil.LOGGER.info("PostInitialization Finished.");
|
|
}
|
|
|
|
@EventHandler
|
|
public void missingMapping(FMLMissingMappingsEvent event){
|
|
int totalRemaps = 0;
|
|
int workedRemaps = 0;
|
|
|
|
for(FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()){
|
|
totalRemaps++;
|
|
|
|
if(ItemUtil.remapName(mapping)){
|
|
workedRemaps++;
|
|
}
|
|
}
|
|
|
|
if(totalRemaps > 0){
|
|
ModUtil.LOGGER.info("Successfully remapped "+workedRemaps+" out of "+totalRemaps+" blocks and items to match the 1.11 naming conventions.");
|
|
}
|
|
}
|
|
}
|