BloodMagic/src/main/java/WayofTime/bloodmagic/compat/jei/BloodMagicJEIPlugin.java

106 lines
5.8 KiB
Java
Raw Normal View History

2016-03-18 11:07:49 +00:00
package WayofTime.bloodmagic.compat.jei;
2018-02-08 05:45:40 +00:00
import WayofTime.bloodmagic.api.impl.BloodMagicAPI;
2018-02-11 19:53:45 +00:00
import WayofTime.bloodmagic.api.impl.recipe.RecipeAlchemyArray;
2018-02-08 05:45:40 +00:00
import WayofTime.bloodmagic.api.impl.recipe.RecipeBloodAltar;
import WayofTime.bloodmagic.api.impl.recipe.RecipeTartaricForge;
import WayofTime.bloodmagic.apibutnotreally.Constants;
import WayofTime.bloodmagic.apibutnotreally.livingArmour.LivingArmourHandler;
import WayofTime.bloodmagic.apibutnotreally.util.helper.ItemHelper.LivingUpgrades;
2016-05-02 17:45:52 +00:00
import WayofTime.bloodmagic.client.gui.GuiSoulForge;
2016-03-18 11:07:49 +00:00
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingCategory;
2018-02-11 19:53:45 +00:00
import WayofTime.bloodmagic.compat.jei.alchemyArray.AlchemyArrayCraftingRecipeJEI;
2016-05-02 17:45:52 +00:00
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeCategory;
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeHandler;
import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeMaker;
2016-03-18 11:07:49 +00:00
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
2018-02-08 05:45:40 +00:00
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeJEI;
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeCategory;
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeHandler;
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeMaker;
2016-03-18 11:07:49 +00:00
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
2018-02-08 05:45:40 +00:00
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeJEI;
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
2017-08-16 04:30:48 +00:00
import mezz.jei.api.*;
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
import java.util.Map;
2016-03-18 11:07:49 +00:00
@JEIPlugin
2018-02-11 19:53:45 +00:00
public class BloodMagicJEIPlugin implements IModPlugin {
2016-03-18 11:07:49 +00:00
public static IJeiHelpers jeiHelper;
@Override
2017-08-16 04:30:48 +00:00
public void register(@Nonnull IModRegistry registry) {
2016-03-18 11:07:49 +00:00
jeiHelper = registry.getJeiHelpers();
2017-08-16 03:21:54 +00:00
registry.addRecipeHandlers(
new BindingRecipeHandler(),
new AlchemyTableRecipeHandler(),
new ArmourDowngradeRecipeHandler()
);
2016-03-18 11:07:49 +00:00
2018-02-08 05:45:40 +00:00
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAltarRecipes(), Constants.Compat.JEI_CATEGORY_ALTAR);
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getTartaricForgeRecipes(), Constants.Compat.JEI_CATEGORY_SOULFORGE);
2018-02-11 19:53:45 +00:00
registry.addRecipes(BloodMagicAPI.INSTANCE.getRecipeRegistrar().getAlchemyArrayRecipes(), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
2018-02-08 05:45:40 +00:00
registry.handleRecipes(RecipeBloodAltar.class, AltarRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALTAR);
registry.handleRecipes(RecipeTartaricForge.class, TartaricForgeRecipeJEI::new, Constants.Compat.JEI_CATEGORY_SOULFORGE);
2018-02-11 19:53:45 +00:00
registry.handleRecipes(RecipeAlchemyArray.class, AlchemyArrayCraftingRecipeJEI::new, Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
2018-02-08 05:45:40 +00:00
2016-03-18 11:07:49 +00:00
registry.addRecipes(BindingRecipeMaker.getRecipes());
2016-05-02 17:45:52 +00:00
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
2016-03-18 11:07:49 +00:00
2017-08-16 03:21:54 +00:00
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), ItemStack.class, "jei.bloodmagic.desc.altarBuilder");
registry.addIngredientInfo(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), ItemStack.class, "jei.bloodmagic.desc.demonicWill");
2016-03-18 11:07:49 +00:00
2017-08-16 04:30:48 +00:00
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet()) {
2016-03-18 11:07:49 +00:00
String key = entry.getKey();
int maxLevel = entry.getValue();
2017-08-16 04:30:48 +00:00
for (int i = 0; i < maxLevel - 1; i++) {
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
LivingUpgrades.setKey(stack, key);
LivingUpgrades.setLevel(stack, i);
2017-08-16 03:21:54 +00:00
jeiHelper.getIngredientBlacklist().addIngredientToBlacklist(stack);
2016-03-18 11:07:49 +00:00
}
}
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
2017-08-16 03:21:54 +00:00
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
registry.addRecipeCatalyst(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
2017-01-02 09:18:02 +00:00
}
2017-01-02 09:18:02 +00:00
@Override
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.BLOOD_ORB);
2016-03-18 11:07:49 +00:00
}
2017-08-16 03:21:54 +00:00
@Override
public void registerCategories(IRecipeCategoryRegistration registry) {
if (jeiHelper == null)
jeiHelper = registry.getJeiHelpers();
registry.addRecipeCategories(
new AltarRecipeCategory(),
new BindingRecipeCategory(),
new AlchemyArrayCraftingCategory(),
new TartaricForgeRecipeCategory(),
new AlchemyTableRecipeCategory(),
new ArmourDowngradeRecipeCategory()
);
}
2016-03-18 11:07:49 +00:00
}