It compiles. Somehow.
This commit is contained in:
parent
554c9852e6
commit
348fee1e2a
150 changed files with 1029 additions and 2186 deletions
|
@ -5,8 +5,8 @@ import java.util.Map;
|
|||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.*;
|
||||
import mezz.jei.api.recipe.IRecipeCategoryRegistration;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.livingArmour.LivingArmourHandler;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
|
@ -29,8 +29,6 @@ import WayofTime.bloodmagic.compat.jei.binding.BindingRecipeMaker;
|
|||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeCategory;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.forge.TartaricForgeRecipeMaker;
|
||||
import WayofTime.bloodmagic.compat.jei.orb.ShapedOrbRecipeHandler;
|
||||
import WayofTime.bloodmagic.compat.jei.orb.ShapelessOrbRecipeHandler;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicBlocks;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
|
||||
|
@ -44,9 +42,14 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
{
|
||||
jeiHelper = registry.getJeiHelpers();
|
||||
|
||||
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 ArmourDowngradeRecipeHandler(), new ShapedOrbRecipeHandler(), new ShapelessOrbRecipeHandler());
|
||||
registry.addRecipeHandlers(
|
||||
new AltarRecipeHandler(),
|
||||
new BindingRecipeHandler(),
|
||||
new AlchemyArrayCraftingRecipeHandler(),
|
||||
new TartaricForgeRecipeHandler(),
|
||||
new AlchemyTableRecipeHandler(),
|
||||
new ArmourDowngradeRecipeHandler()
|
||||
);
|
||||
|
||||
registry.addRecipes(AltarRecipeMaker.getRecipes());
|
||||
registry.addRecipes(BindingRecipeMaker.getRecipes());
|
||||
|
@ -55,14 +58,8 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
registry.addRecipes(AlchemyTableRecipeMaker.getRecipes());
|
||||
registry.addRecipes(ArmourDowngradeRecipeMaker.getRecipes());
|
||||
|
||||
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.ALTAR_MAKER), "jei.bloodmagic.desc.altarBuilder");
|
||||
registry.addDescription(new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL), "jei.bloodmagic.desc.demonicWill");
|
||||
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_LIGHT));
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.SPECTRAL));
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.PHANTOM));
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_ARRAY));
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(RegistrarBloodMagicBlocks.DIMENSIONAL_PORTAL, 1, OreDictionary.WILDCARD_VALUE));
|
||||
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");
|
||||
|
||||
for (Map.Entry<String, Integer> entry : LivingArmourHandler.upgradeMaxLevelMap.entrySet())
|
||||
{
|
||||
|
@ -73,22 +70,37 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
ItemStack stack = new ItemStack(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
LivingUpgrades.setKey(stack, key);
|
||||
LivingUpgrades.setLevel(stack, i);
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(stack);
|
||||
jeiHelper.getIngredientBlacklist().addIngredientToBlacklist(stack);
|
||||
}
|
||||
}
|
||||
|
||||
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE), Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES), Constants.Compat.JEI_CATEGORY_BINDING);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.ALCHEMY_TABLE), Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE);
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER), Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE);
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
|
||||
subtypeRegistry.useNbtForSubtypes(RegistrarBloodMagicItems.UPGRADE_TOME);
|
||||
}
|
||||
|
||||
@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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -74,4 +75,9 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class AlchemyArrayCraftingRecipeMaker
|
|||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectCrafting)
|
||||
{
|
||||
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
||||
ItemStack output = ((AlchemyArrayEffectCrafting) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||
|
||||
AlchemyArrayCraftingRecipeJEI recipe = new AlchemyArrayCraftingRecipeJEI(input, catalyst, output);
|
||||
recipes.add(recipe);
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
|
@ -75,4 +76,9 @@ public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTable
|
|||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.List;
|
|||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -14,7 +13,6 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
|||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
private AlchemyTableRecipe recipe;
|
||||
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
|
||||
|
@ -41,4 +39,8 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public AlchemyTableRecipe getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import javax.annotation.Nullable;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -72,4 +73,9 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||
{
|
||||
minecraft.fontRendererObj.drawString(infoString[0], 90 - minecraft.fontRendererObj.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
||||
minecraft.fontRendererObj.drawString(infoString[1], 90 - minecraft.fontRendererObj.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||
minecraft.fontRenderer.drawString(infoString[0], 90 - minecraft.fontRenderer.getStringWidth(infoString[0]) / 2, 0, Color.gray.getRGB());
|
||||
minecraft.fontRenderer.drawString(infoString[1], 90 - minecraft.fontRenderer.getStringWidth(infoString[1]) / 2, 10, Color.gray.getRGB());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
|
@ -94,4 +95,9 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
|||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -14,7 +13,6 @@ import java.util.List;
|
|||
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
private LivingArmourDowngradeRecipe recipe;
|
||||
|
||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
||||
|
@ -31,4 +29,8 @@ public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
|||
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
||||
ingredients.setOutput(ItemStack.class, upgradeStack);
|
||||
}
|
||||
|
||||
public LivingArmourDowngradeRecipe getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.binding;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
|
@ -72,4 +73,9 @@ public class BindingRecipeCategory implements IRecipeCategory
|
|||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class BindingRecipeMaker
|
|||
ItemStack catalyst = entry.getKey().toStack();
|
||||
if (AlchemyArrayRecipeRegistry.getAlchemyArrayEffect(input, catalyst) instanceof AlchemyArrayEffectBinding)
|
||||
{
|
||||
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).getOutputStack();
|
||||
ItemStack output = ((AlchemyArrayEffectBinding) itemStackAlchemyArrayRecipeEntry.getValue().getAlchemyArrayEffectForCatalyst(catalyst)).outputStack;
|
||||
|
||||
BindingRecipeJEI recipe = new BindingRecipeJEI(input, catalyst, output);
|
||||
recipes.add(recipe);
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
|
@ -101,4 +102,9 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModName() {
|
||||
return BloodMagic.NAME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -16,9 +15,7 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
|||
|
||||
public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
private TartaricForgeRecipe recipe;
|
||||
@Getter
|
||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
|
||||
|
@ -70,4 +67,12 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
this.minSouls = minSouls;
|
||||
}
|
||||
}
|
||||
|
||||
public TartaricForgeRecipe getRecipe() {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
public List<ItemStack> getValidGems() {
|
||||
return validGems;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.orb;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import WayofTime.bloodmagic.api.recipe.ShapedBloodOrbRecipe;
|
||||
|
||||
public class ShapedOrbRecipeHandler implements IRecipeHandler<ShapedBloodOrbRecipe>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ShapedBloodOrbRecipe> getRecipeClass()
|
||||
{
|
||||
return ShapedBloodOrbRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String getRecipeCategoryUid(@Nonnull ShapedBloodOrbRecipe recipe)
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapedBloodOrbRecipe recipe)
|
||||
{
|
||||
return new ShapedOrbRecipeJEI(Arrays.asList(recipe.getInput()), recipe.getTier(), recipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ShapedBloodOrbRecipe recipe)
|
||||
{
|
||||
return recipe.getInput().length > 0;
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.orb;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ShapedOrbRecipeJEI extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final List inputs;
|
||||
|
||||
private final int tier;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ShapedOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
||||
{
|
||||
ArrayList inputList = new ArrayList(input);
|
||||
|
||||
for (Object object : inputList)
|
||||
if (object instanceof Integer)
|
||||
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
||||
|
||||
this.inputs = inputList;
|
||||
this.tier = tier;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
|
||||
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.orb;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import WayofTime.bloodmagic.api.recipe.ShapelessBloodOrbRecipe;
|
||||
|
||||
public class ShapelessOrbRecipeHandler implements IRecipeHandler<ShapelessBloodOrbRecipe>
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Class<ShapelessBloodOrbRecipe> getRecipeClass()
|
||||
{
|
||||
return ShapelessBloodOrbRecipe.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ShapelessBloodOrbRecipe recipe)
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapelessBloodOrbRecipe recipe)
|
||||
{
|
||||
return new ShapelessOrbRecipeJEI(recipe.getInput(), recipe.getTier(), recipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ShapelessBloodOrbRecipe recipe)
|
||||
{
|
||||
return recipe.getInput().size() > 0;
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei.orb;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ShapelessOrbRecipeJEI extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final List inputs;
|
||||
private final int tier;
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public ShapelessOrbRecipeJEI(@Nonnull List input, int tier, @Nonnull ItemStack output)
|
||||
{
|
||||
ArrayList inputList = new ArrayList(input);
|
||||
|
||||
for (Object object : inputList)
|
||||
if (object instanceof Integer)
|
||||
inputList.set(inputList.indexOf(object), OrbRegistry.getOrbsDownToTier((Integer) object));
|
||||
|
||||
this.inputs = inputList;
|
||||
this.tier = tier;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(inputs);
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||
{
|
||||
String draw = TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier));
|
||||
minecraft.fontRendererObj.drawString(draw, 72 - minecraft.fontRendererObj.getStringWidth(draw) / 2, 10, Color.gray.getRGB());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue