2015-11-02 12:39:44 -08:00
|
|
|
package WayofTime.bloodmagic;
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.annot.Handler;
|
2017-08-16 16:39:57 -07:00
|
|
|
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.api.registry.RitualRegistry;
|
|
|
|
import WayofTime.bloodmagic.api.util.helper.LogHelper;
|
2017-08-15 18:14:28 -07:00
|
|
|
import WayofTime.bloodmagic.api_impl.BloodMagicAPI;
|
|
|
|
import WayofTime.bloodmagic.apiv2.BloodMagicPlugin;
|
|
|
|
import WayofTime.bloodmagic.apiv2.IBloodMagicPlugin;
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.client.gui.GuiHandler;
|
2017-01-02 00:10:28 -08:00
|
|
|
import WayofTime.bloodmagic.command.CommandBloodMagic;
|
2017-08-16 16:39:57 -07:00
|
|
|
import WayofTime.bloodmagic.core.RegistrarBloodMagic;
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
2016-09-12 19:54:46 -07:00
|
|
|
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
|
|
|
import WayofTime.bloodmagic.proxy.CommonProxy;
|
|
|
|
import WayofTime.bloodmagic.registry.*;
|
|
|
|
import WayofTime.bloodmagic.structures.ModDungeons;
|
2017-08-15 18:14:28 -07:00
|
|
|
import WayofTime.bloodmagic.util.PluginUtil;
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.util.Utils;
|
|
|
|
import WayofTime.bloodmagic.util.handler.IMCHandler;
|
2017-08-15 18:14:28 -07:00
|
|
|
import com.google.common.collect.Lists;
|
2016-08-20 17:16:07 -04:00
|
|
|
import net.minecraft.creativetab.CreativeTabs;
|
2016-12-12 19:56:36 -08:00
|
|
|
import net.minecraft.item.ItemStack;
|
2016-08-20 17:16:07 -04:00
|
|
|
import net.minecraft.launchwrapper.Launch;
|
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
|
|
|
import net.minecraftforge.fml.common.Mod;
|
|
|
|
import net.minecraftforge.fml.common.SidedProxy;
|
2017-02-27 17:37:30 -08:00
|
|
|
import net.minecraftforge.fml.common.event.*;
|
2016-08-20 17:16:07 -04:00
|
|
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
2017-08-15 18:14:28 -07:00
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2016-03-17 13:00:44 -07:00
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
import java.io.File;
|
|
|
|
import java.util.List;
|
|
|
|
|
2017-08-14 20:53:42 -07:00
|
|
|
@Mod(modid = BloodMagic.MODID, name = BloodMagic.NAME, version = BloodMagic.VERSION, dependencies = BloodMagic.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
|
2017-08-15 21:30:48 -07:00
|
|
|
public class BloodMagic {
|
2017-08-14 20:53:42 -07: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;";
|
2017-08-15 21:30:48 -07:00
|
|
|
public static final CreativeTabs TAB_BM = new CreativeTabs(MODID + ".creativeTab") {
|
2014-10-13 22:33:20 +02:00
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public ItemStack getTabIconItem() {
|
2017-08-16 16:39:57 -07:00
|
|
|
return OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK);
|
2014-10-13 22:33:20 +02:00
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
};
|
2017-08-15 21:30:48 -07:00
|
|
|
public static final boolean IS_DEV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
|
|
|
public static final List<Pair<IBloodMagicPlugin, BloodMagicPlugin>> PLUGINS = Lists.newArrayList();
|
|
|
|
public static CreativeTabs TAB_TOMES = new CreativeTabs(MODID + ".creativeTabTome") {
|
2016-01-09 22:20:59 -05:00
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public ItemStack getTabIconItem() {
|
2017-08-14 20:53:42 -07:00
|
|
|
return new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
2016-01-09 22:20:59 -05:00
|
|
|
}
|
2016-12-11 20:28:47 -05:00
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public boolean hasSearchBar() {
|
2016-12-11 20:28:47 -05:00
|
|
|
return true;
|
|
|
|
}
|
2017-08-15 21:24:59 -07:00
|
|
|
}.setNoTitle().setBackgroundImageName("item_search.png");
|
2016-06-05 12:31:35 -07:00
|
|
|
|
2017-08-14 20:53:42 -07: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-15 21:30:48 -07:00
|
|
|
static {
|
|
|
|
FluidRegistry.enableUniversalBucket();
|
|
|
|
}
|
|
|
|
|
2017-08-14 20:53:42 -07:00
|
|
|
public LogHelper logger = new LogHelper(MODID);
|
2015-10-29 20:22:14 -07:00
|
|
|
private File configDir;
|
2014-06-27 19:43:09 -04:00
|
|
|
|
2015-10-29 20:22:14 -07:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
2015-10-29 20:22:14 -07:00
|
|
|
configDir = new File(event.getModConfigurationDirectory(), "BloodMagic");
|
2017-08-14 20:53:42 -07:00
|
|
|
ConfigHandler.init(new File(configDir, "BloodMagic.cfg"));
|
|
|
|
|
2017-08-15 18:14:28 -07:00
|
|
|
PLUGINS.addAll(PluginUtil.getPlugins(event.getAsmData()));
|
|
|
|
|
2016-01-23 16:25:39 -05:00
|
|
|
ModTranquilityHandlers.init();
|
2016-08-20 17:16:07 -04:00
|
|
|
ModDungeons.init();
|
2015-10-29 22:22:08 -07:00
|
|
|
|
2016-05-30 18:20:31 -07:00
|
|
|
Utils.registerHandlers(event.getAsmData().getAll(Handler.class.getCanonicalName()));
|
2015-10-29 22:22:08 -07:00
|
|
|
proxy.preInit();
|
2014-08-10 14:38:51 -04:00
|
|
|
}
|
2015-03-21 10:10:25 -04:00
|
|
|
|
2015-10-29 20:22:14 -07:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void init(FMLInitializationEvent event) {
|
2015-11-27 20:15:19 -05:00
|
|
|
BloodMagicPacketHandler.init();
|
2015-10-30 16:54:59 -07:00
|
|
|
|
2015-11-07 11:51:41 -05:00
|
|
|
ModRecipes.init();
|
2015-11-02 17:45:11 -08:00
|
|
|
ModRituals.initRituals();
|
|
|
|
ModRituals.initImperfectRituals();
|
2016-09-12 19:54:46 -07:00
|
|
|
MeteorConfigHandler.init(new File(configDir, "meteors"));
|
2016-01-02 22:04:51 -05:00
|
|
|
ModArmourTrackers.init();
|
2016-01-01 12:08:17 -05:00
|
|
|
NetworkRegistry.INSTANCE.registerGuiHandler(BloodMagic.instance, new GuiHandler());
|
2016-09-18 18:44:18 -04:00
|
|
|
ModCorruptionBlocks.init();
|
2015-11-02 17:45:11 -08:00
|
|
|
|
2015-10-29 20:22:14 -07:00
|
|
|
proxy.init();
|
2014-10-31 15:31:56 -04:00
|
|
|
}
|
2014-11-12 17:14:43 -05:00
|
|
|
|
2015-10-29 20:22:14 -07:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void postInit(FMLPostInitializationEvent event) {
|
2015-12-28 19:09:51 -05:00
|
|
|
ModRecipes.addCompressionHandlers();
|
|
|
|
|
2017-08-17 21:52:20 -07:00
|
|
|
for (Pair<IBloodMagicPlugin, BloodMagicPlugin> plugin : PLUGINS)
|
|
|
|
plugin.getLeft().register(BloodMagicAPI.INSTANCE);
|
|
|
|
|
2015-10-29 20:22:14 -07:00
|
|
|
proxy.postInit();
|
2014-12-13 19:17:38 -05:00
|
|
|
}
|
2016-01-30 14:58:37 -08:00
|
|
|
|
2017-02-27 17:37:30 -08:00
|
|
|
@Mod.EventHandler
|
|
|
|
public void loadComplete(FMLLoadCompleteEvent event) {
|
|
|
|
RitualRegistry.orderLookupList();
|
|
|
|
}
|
|
|
|
|
2016-08-26 19:03:43 -07:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void modMapping(FMLModIdMappingEvent event) {
|
2017-08-14 20:53:42 -07:00
|
|
|
|
2016-08-26 19:03:43 -07:00
|
|
|
}
|
|
|
|
|
2016-03-14 19:00:03 -07:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void serverStarting(FMLServerStartingEvent event) {
|
2016-03-14 19:00:03 -07:00
|
|
|
event.registerServerCommand(new CommandBloodMagic());
|
|
|
|
}
|
|
|
|
|
2016-01-30 14:58:37 -08:00
|
|
|
@Mod.EventHandler
|
2017-08-15 21:30:48 -07:00
|
|
|
public void onIMCRecieved(FMLInterModComms.IMCEvent event) {
|
2016-02-15 15:01:03 -08:00
|
|
|
IMCHandler.handleIMC(event);
|
2016-01-30 14:58:37 -08:00
|
|
|
}
|
2014-06-27 19:43:09 -04:00
|
|
|
}
|