2015-11-02 20:39:44 +00:00
|
|
|
package WayofTime.bloodmagic;
|
2014-06-27 23:43:09 +00:00
|
|
|
|
2018-02-15 07:38:57 +00:00
|
|
|
import WayofTime.bloodmagic.api.BloodMagicPlugin;
|
|
|
|
import WayofTime.bloodmagic.api.IBloodMagicPlugin;
|
2018-02-16 02:49:01 +00:00
|
|
|
import WayofTime.bloodmagic.core.registry.OrbRegistry;
|
2018-06-29 04:56:25 +00:00
|
|
|
import WayofTime.bloodmagic.ritual.RitualManager;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.client.gui.GuiHandler;
|
2017-01-02 08:10:28 +00:00
|
|
|
import WayofTime.bloodmagic.command.CommandBloodMagic;
|
2017-08-16 23:39:57 +00:00
|
|
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
2016-09-13 02:54:46 +00:00
|
|
|
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
|
|
|
import WayofTime.bloodmagic.proxy.CommonProxy;
|
|
|
|
import WayofTime.bloodmagic.registry.*;
|
|
|
|
import WayofTime.bloodmagic.structures.ModDungeons;
|
2017-08-16 01:14:28 +00:00
|
|
|
import WayofTime.bloodmagic.util.PluginUtil;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.util.handler.IMCHandler;
|
2017-08-16 01:14:28 +00:00
|
|
|
import com.google.common.collect.Lists;
|
2016-08-20 21:16:07 +00:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2016-12-13 03:56:36 +00:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-08-20 21:16:07 +00:00
|
|
|
import net.minecraft.launchwrapper.Launch;
|
2018-06-29 04:56:25 +00:00
|
|
|
import net.minecraftforge.common.config.Configuration;
|
2016-08-20 21:16:07 +00:00
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
2018-06-29 04:56:25 +00:00
|
|
|
import net.minecraftforge.fml.common.Loader;
|
2016-08-20 21:16:07 +00:00
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.SidedProxy;
|
2017-02-28 01:37:30 +00:00
|
|
|
import net.minecraftforge.fml.common.event.*;
|
2016-08-20 21:16:07 +00:00
|
|
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
2017-08-16 01:14:28 +00:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2016-03-17 20:00:44 +00:00
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
import java.io.File;
|
|
|
|
import java.util.List;
|
|
|
|
|
2018-06-29 03:37:53 +00:00
|
|
|
@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.GuiBloodMagicConfig$Factory")
|
2017-08-16 04:30:48 +00:00
|
|
|
public class BloodMagic {
|
2017-08-15 03:53:42 +00:00
|
|
|
public static final String MODID = "bloodmagic";
|
|
|
|
public static final String NAME = "Blood Magic: Alchemical Wizardry";
|
|
|
|
public static final String VERSION = "@VERSION@";
|
|
|
|
public static final String DEPEND = "required-after:guideapi;";
|
2018-03-02 02:23:56 +00:00
|
|
|
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
|
|
|
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
2018-06-29 04:56:25 +00:00
|
|
|
public static final RitualManager RITUAL_MANAGER = new RitualManager(new Configuration(new File(Loader.instance().getConfigDir(), MODID + "/" + "rituals.cfg")));
|
2017-08-16 04:30:48 +00:00
|
|
|
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
|
2014-10-13 20:33:20 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public ItemStack getTabIconItem() {
|
2017-08-16 23:39:57 +00:00
|
|
|
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
|
2014-10-13 20:33:20 +00:00
|
|
|
}
|
2014-06-27 23:43:09 +00:00
|
|
|
};
|
2017-08-16 04:30:48 +00:00
|
|
|
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
|
2016-01-10 03:20:59 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public ItemStack getTabIconItem() {
|
2017-08-15 03:53:42 +00:00
|
|
|
return new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
2016-01-10 03:20:59 +00:00
|
|
|
}
|
2016-12-12 01:28:47 +00:00
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean hasSearchBar() {
|
2016-12-12 01:28:47 +00:00
|
|
|
return true;
|
|
|
|
}
|
2017-08-16 04:24:59 +00:00
|
|
|
}.setNoTitle().setBackgroundImageName("item_search.png");
|
2016-06-05 19:31:35 +00:00
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
@SidedProxy(serverSide = "WayofTime.bloodmagic.proxy.CommonProxy", clientSide = "WayofTime.bloodmagic.proxy.ClientProxy")
|
|
|
|
public static CommonProxy proxy;
|
|
|
|
@Mod.Instance(BloodMagic.MODID)
|
|
|
|
public static BloodMagic instance;
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
static {
|
|
|
|
FluidRegistry.enableUniversalBucket();
|
|
|
|
}
|
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
private File configDir;
|
2014-06-27 23:43:09 +00:00
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
2017-08-20 01:56:50 +00:00
|
|
|
configDir = new File(event.getModConfigurationDirectory(), "bloodmagic");
|
2017-08-15 03:53:42 +00:00
|
|
|
|
2018-02-17 17:48:17 +00:00
|
|
|
PLUGINS.addAll(PluginUtil.gatherPlugins(event.getAsmData()));
|
2018-03-01 01:53:23 +00:00
|
|
|
PluginUtil.injectAPIInstances(PluginUtil.gatherInjections(event.getAsmData()));
|
2017-08-16 01:14:28 +00:00
|
|
|
|
2016-01-23 21:25:39 +00:00
|
|
|
ModTranquilityHandlers.init();
|
2016-08-20 21:16:07 +00:00
|
|
|
ModDungeons.init();
|
2018-06-29 04:56:25 +00:00
|
|
|
RITUAL_MANAGER.discover(event.getAsmData());
|
2015-10-30 05:22:08 +00:00
|
|
|
|
|
|
|
proxy.preInit();
|
2014-08-10 18:38:51 +00:00
|
|
|
}
|
2015-03-21 14:10:25 +00:00
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void init(FMLInitializationEvent event) {
|
2015-11-28 01:15:19 +00:00
|
|
|
BloodMagicPacketHandler.init();
|
2018-02-17 17:48:17 +00:00
|
|
|
|
2018-03-01 01:53:23 +00:00
|
|
|
PluginUtil.handlePluginStep(PluginUtil.RegistrationStep.PLUGIN_REGISTER);
|
2015-10-30 23:54:59 +00:00
|
|
|
|
2015-11-07 16:51:41 +00:00
|
|
|
ModRecipes.init();
|
2018-06-29 04:56:25 +00:00
|
|
|
ModRituals.initHarvestHandlers();
|
2018-12-31 00:14:27 +00:00
|
|
|
ModRituals.initCuttingFluids();
|
2016-09-13 02:54:46 +00:00
|
|
|
MeteorConfigHandler.init(new File(configDir, "meteors"));
|
2016-01-03 03:04:51 +00:00
|
|
|
ModArmourTrackers.init();
|
2016-01-01 17:08:17 +00:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(BloodMagic.instance, new GuiHandler());
|
2016-09-18 22:44:18 +00:00
|
|
|
ModCorruptionBlocks.init();
|
2015-11-03 01:45:11 +00:00
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
proxy.init();
|
2014-10-31 19:31:56 +00:00
|
|
|
}
|
2014-11-12 22:14:43 +00:00
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void postInit(FMLPostInitializationEvent event) {
|
2015-12-29 00:09:51 +00:00
|
|
|
ModRecipes.addCompressionHandlers();
|
|
|
|
|
2015-10-30 03:22:14 +00:00
|
|
|
proxy.postInit();
|
2014-12-14 00:17:38 +00:00
|
|
|
}
|
2016-01-30 22:58:37 +00:00
|
|
|
|
2016-08-27 02:03:43 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void modMapping(FMLModIdMappingEvent event) {
|
2017-08-15 03:53:42 +00:00
|
|
|
|
2016-08-27 02:03:43 +00:00
|
|
|
}
|
|
|
|
|
2016-03-15 02:00:03 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void serverStarting(FMLServerStartingEvent event) {
|
2016-03-15 02:00:03 +00:00
|
|
|
event.registerServerCommand(new CommandBloodMagic());
|
|
|
|
}
|
|
|
|
|
2016-01-30 22:58:37 +00:00
|
|
|
@Mod.EventHandler
|
2017-08-16 04:30:48 +00:00
|
|
|
public void onIMCRecieved(FMLInterModComms.IMCEvent event) {
|
2016-02-15 23:01:03 +00:00
|
|
|
IMCHandler.handleIMC(event);
|
2016-01-30 22:58:37 +00:00
|
|
|
}
|
2014-06-27 23:43:09 +00:00
|
|
|
}
|