Made it so you can view the recipes for downgrades in JEI.
This commit is contained in:
parent
1f6c4b47e2
commit
33b799723c
|
@ -154,6 +154,7 @@ public class Constants
|
|||
public static final String JEI_CATEGORY_ALCHEMYARRAY = Mod.MODID + ":alchemyArray";
|
||||
public static final String JEI_CATEGORY_SOULFORGE = Mod.MODID + ":soulForge";
|
||||
public static final String JEI_CATEGORY_ALCHEMYTABLE = Mod.MODID + ":salchemyTable";
|
||||
public static final String JEI_CATEGORY_ARMOURDOWNGRADE = Mod.MODID + ":armourDowngrade";
|
||||
|
||||
public static final String WAILA_CONFIG_BYPASS_SNEAK = Mod.MODID + ".bypassSneak";
|
||||
public static final String WAILA_CONFIG_ALTAR = Mod.MODID + ".bloodAltar";
|
||||
|
|
|
@ -134,6 +134,11 @@ public class LivingArmourDowngradeRecipe
|
|||
return this.input;
|
||||
}
|
||||
|
||||
public ItemStack getKey()
|
||||
{
|
||||
return this.keyStack;
|
||||
}
|
||||
|
||||
public void consumeInventory(IItemHandler inv)
|
||||
{
|
||||
for (int i = 0; i < inv.getSlots(); i++)
|
||||
|
|
|
@ -101,6 +101,15 @@ public class ItemHelper
|
|||
return null;
|
||||
}
|
||||
|
||||
public static void setUpgrade(ItemStack stack, LivingArmourUpgrade upgrade)
|
||||
{
|
||||
if (stack.getItem() instanceof ItemUpgradeTome || stack.getItem() instanceof IUpgradeTrainer)
|
||||
{
|
||||
setKey(stack, upgrade.getUniqueIdentifier());
|
||||
setLevel(stack, upgrade.getUpgradeLevel());
|
||||
}
|
||||
}
|
||||
|
||||
public static void setKey(ItemStack stack, String key)
|
||||
{
|
||||
if (stack.getItem() instanceof ItemUpgradeTome || stack.getItem() instanceof IUpgradeTrainer)
|
||||
|
|
|
@ -23,6 +23,9 @@ import WayofTime.bloodmagic.compat.jei.alchemyTable.AlchemyTableRecipeMaker;
|
|||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.altar.AltarRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.armourDowngrade.ArmourDowngradeRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
||||
|
@ -44,15 +47,16 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
{
|
||||
jeiHelper = registry.getJeiHelpers();
|
||||
|
||||
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory(), new TartaricForgeRecipeCategory(), new AlchemyTableRecipeCategory());
|
||||
registry.addRecipeCategories(new AltarRecipeCategory(), new BindingRecipeCategory(), new AlchemyArrayCraftingCategory(), new TartaricForgeRecipeCategory(), new AlchemyTableRecipeCategory(), new ArmourDowngradeRecipeCategory());
|
||||
|
||||
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler(), new TartaricForgeRecipeHandler(), new AlchemyTableRecipeHandler(), new ShapedOrbRecipeHandler(), new ShapelessOrbRecipeHandler());
|
||||
registry.addRecipeHandlers(new AltarRecipeHandler(), new BindingRecipeHandler(), new AlchemyArrayCraftingRecipeHandler(), new TartaricForgeRecipeHandler(), new AlchemyTableRecipeHandler(), new ArmourDowngradeRecipeHandler(), new ShapedOrbRecipeHandler(), new ShapelessOrbRecipeHandler());
|
||||
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyArrayCraftingRecipeMaker.getRecipes());
|
||||
registry.addRecipes(TartaricForgeRecipeMaker.getRecipes());
|
||||
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
||||
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
||||
|
||||
registry.addDescription(new ItemStack(ModItems.ALTAR_MAKER), "jei.BloodMagic.desc.altarBuilder");
|
||||
registry.addDescription(new ItemStack(ModItems.MONSTER_SOUL), "jei.BloodMagic.desc.demonicWill");
|
||||
|
@ -83,6 +87,7 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
|
||||
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_UUID);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.OWNER_NAME);
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
||||
{
|
||||
private static final int OUTPUT_SLOT = 0;
|
||||
private static final int KEY_SLOT = 1;
|
||||
private static final int INPUT_SLOT = 2;
|
||||
|
||||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/alchemyTable.png"), 0, 0, 118, 40);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.armourDowngrade");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
public ArmourDowngradeRecipeCategory()
|
||||
{
|
||||
craftingGridHelper = BloodMagicPlugin.jeiHelper.getGuiHelper().createCraftingGridHelper(INPUT_SLOT, OUTPUT_SLOT);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getTitle()
|
||||
{
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IDrawable getBackground()
|
||||
{
|
||||
return background;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
guiItemStacks.init(OUTPUT_SLOT, false, 91, 13);
|
||||
guiItemStacks.init(KEY_SLOT, true, 60, 0);
|
||||
|
||||
for (int y = 0; y < 3; ++y)
|
||||
{
|
||||
for (int x = 0; x < 3; ++x)
|
||||
{
|
||||
int index = INPUT_SLOT + x + (y * 3);
|
||||
guiItemStacks.init(index, true, x * 18, y * 18 - 18);
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI)
|
||||
{
|
||||
ArmourDowngradeRecipeJEI recipe = (ArmourDowngradeRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(KEY_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
|
||||
public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngradeRecipeJEI>
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ArmourDowngradeRecipeJEI> getRecipeClass()
|
||||
{
|
||||
return ArmourDowngradeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
return recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
private LivingArmourDowngradeRecipe recipe;
|
||||
|
||||
// @Getter
|
||||
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
||||
{
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<Collection> getInputs()
|
||||
{
|
||||
ArrayList<Collection> ret = new ArrayList<Collection>();
|
||||
ret.add(recipe.getInput());
|
||||
ret.add(Lists.newArrayList(recipe.getKey()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
ItemStack upgradeStack = new ItemStack(ModItems.UPGRADE_TOME);
|
||||
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
||||
return Collections.singletonList(upgradeStack);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
// ArrayList<String> ret = new ArrayList<String>();
|
||||
// if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
|
||||
// {
|
||||
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
// return ret;
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.LivingArmourDowngradeRecipeRegistry;
|
||||
|
||||
public class ArmourDowngradeRecipeMaker
|
||||
{
|
||||
@Nonnull
|
||||
public static List<ArmourDowngradeRecipeJEI> getRecipes()
|
||||
{
|
||||
List<LivingArmourDowngradeRecipe> recipeList = LivingArmourDowngradeRecipeRegistry.getRecipeList();
|
||||
ArrayList<ArmourDowngradeRecipeJEI> recipes = new ArrayList<ArmourDowngradeRecipeJEI>();
|
||||
|
||||
for (LivingArmourDowngradeRecipe recipe : recipeList)
|
||||
recipes.add(new ArmourDowngradeRecipeJEI(recipe));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
|
@ -25,6 +25,7 @@ import WayofTime.bloodmagic.ritual.RitualHarvest;
|
|||
import WayofTime.bloodmagic.ritual.RitualInterdiction;
|
||||
import WayofTime.bloodmagic.ritual.RitualJumping;
|
||||
import WayofTime.bloodmagic.ritual.RitualLava;
|
||||
import WayofTime.bloodmagic.ritual.RitualLivingArmourDowngrade;
|
||||
import WayofTime.bloodmagic.ritual.RitualMagnetic;
|
||||
import WayofTime.bloodmagic.ritual.RitualMeteor;
|
||||
import WayofTime.bloodmagic.ritual.RitualPlacer;
|
||||
|
@ -149,8 +150,8 @@ public class ModRituals
|
|||
meteorRitual = new RitualMeteor();
|
||||
RitualRegistry.registerRitual(meteorRitual, ConfigHandler.meteorRitual);
|
||||
|
||||
// downgradeRitual = new RitualLivingArmourDowngrade();
|
||||
// RitualRegistry.registerRitual(downgradeRitual, ConfigHandler.downgradeRitual);
|
||||
downgradeRitual = new RitualLivingArmourDowngrade();
|
||||
RitualRegistry.registerRitual(downgradeRitual, ConfigHandler.downgradeRitual);
|
||||
|
||||
RitualCrushing.registerCuttingFluid(ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC), 250, 0.5);
|
||||
RitualCrushing.registerCuttingFluid(ItemCuttingFluid.getStack(ItemCuttingFluid.EXPLOSIVE), 25, 0.05);
|
||||
|
|
|
@ -605,7 +605,7 @@ ritual.BloodMagic.fellingRitual=Crash of the Timberman
|
|||
ritual.BloodMagic.pumpRitual=Hymn of Siphoning
|
||||
ritual.BloodMagic.altarBuilderRitual=The Assembly of the High Altar
|
||||
ritual.BloodMagic.portalRitual=The Gate of the Fold
|
||||
ritual.BloodMagic.downgradeRitual=Downgrade Ritual
|
||||
ritual.BloodMagic.downgradeRitual=Penance of the Leadened Soul
|
||||
|
||||
ritual.BloodMagic.waterRitual.info=Generates a source of water from the master ritual stone.
|
||||
ritual.BloodMagic.lavaRitual.info=Generates a source of lava from the master ritual stone.
|
||||
|
@ -849,6 +849,7 @@ jei.BloodMagic.recipe.binding=Alchemy Array (Binding)
|
|||
jei.BloodMagic.recipe.alchemyArrayCrafting=Alchemy Array
|
||||
jei.BloodMagic.recipe.soulForge=Hellfire Forge
|
||||
jei.BloodMagic.recipe.alchemyTable=Alchemy Table
|
||||
jei.BloodMagic.recipe.armourDowngrade=Penance (Ritual)
|
||||
jei.BloodMagic.recipe.requiredLP=LP: %d
|
||||
jei.BloodMagic.recipe.requiredTier=Tier: %d
|
||||
jei.BloodMagic.recipe.consumptionRate=Consumption: %d LP/t
|
||||
|
|
Loading…
Reference in a new issue