Fix JEI compat
This commit is contained in:
parent
4ec321aaac
commit
574056203d
|
@ -56,8 +56,8 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
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");
|
||||
registry.addDescription(new ItemStack(ModItems.ALTAR_MAKER), "jei.bloodmagic.desc.altarBuilder");
|
||||
registry.addDescription(new ItemStack(ModItems.MONSTER_SOUL), "jei.bloodmagic.desc.demonicWill");
|
||||
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.BLOOD_LIGHT));
|
||||
jeiHelper.getItemBlacklist().addItemToBlacklist(new ItemStack(ModBlocks.SPECTRAL_BLOCK));
|
||||
|
@ -78,8 +78,6 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
}
|
||||
}
|
||||
|
||||
jeiHelper.getSubtypeRegistry().useNbtForSubtypes(Item.getItemFromBlock(ModBlocks.BLOOD_TANK));
|
||||
|
||||
registry.addRecipeClickArea(GuiSoulForge.class, 115, 15, 16, 88, Constants.Compat.JEI_CATEGORY_SOULFORGE);
|
||||
|
||||
registry.addRecipeCategoryCraftingItem(new ItemStack(ModBlocks.ALTAR), Constants.Compat.JEI_CATEGORY_ALTAR);
|
||||
|
@ -88,15 +86,10 @@ public class BloodMagicPlugin extends BlankModPlugin
|
|||
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);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.USES);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.SOULS);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.X_COORD);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Y_COORD);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.Z_COORD);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.DIMENSION_ID);
|
||||
jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(Constants.NBT.ITEM_INVENTORY);
|
||||
@Override
|
||||
public void registerItemSubtypes(ISubtypeRegistry subtypeRegistry) {
|
||||
subtypeRegistry.useNbtForSubtypes(Item.getItemFromBlock(ModBlocks.BLOOD_TANK));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.jei;
|
||||
|
||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||
|
||||
public class CompatibilityJustEnoughItems implements ICompatibility
|
||||
{
|
||||
@Override
|
||||
public void loadCompatibility(InitializationPhase phase)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModId()
|
||||
{
|
||||
return "JEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCompat()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.alchemyArrayCrafting");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyArrayCrafting");
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
|
@ -69,10 +69,9 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
|
||||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
|
||||
{
|
||||
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<Alchemy
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -14,10 +14,8 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
|||
{
|
||||
@Nonnull
|
||||
private final List<ItemStack> inputs;
|
||||
|
||||
@Nullable
|
||||
private final ItemStack catalyst;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
|
@ -35,7 +33,7 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
|||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setOutputs(ItemStack.class, Collections.singletonList(output));
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst)));
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
|
|||
@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.alchemyTable");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.alchemyTable");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
|
|
|
@ -31,6 +31,6 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AlchemyTableRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
|
@ -22,7 +23,8 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
// ingredients.setInputLists(ItemStack.class, Lists.<ItemStack>newArrayList(recipe.getInput(), OrbRegistry.getOrbsDownToTier(recipe.getTierRequired())));
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(new ArrayList<ItemStack>()));
|
||||
}
|
||||
|
||||
|
@ -32,8 +34,8 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
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()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/altar.png"), 3, 4, 155, 65);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.altar");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.altar");
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
|
@ -68,9 +68,7 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
|
||||
if (recipeWrapper instanceof AltarRecipeJEI)
|
||||
{
|
||||
AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper;
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, inputs.get(0));
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,6 @@ public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
{
|
||||
@Nonnull
|
||||
private final List<ItemStack> input;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
|
@ -30,7 +29,7 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
this.input = input;
|
||||
this.output = output;
|
||||
|
||||
this.infoString = new String[] { TextHelper.localize("jei.BloodMagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.BloodMagic.recipe.requiredLP", requiredLP) };
|
||||
this.infoString = new String[] { TextHelper.localize("jei.bloodmagic.recipe.requiredTier", NumeralHelper.toRoman(tier)), TextHelper.localize("jei.bloodmagic.recipe.requiredLP", requiredLP) };
|
||||
this.consumptionRate = consumptionRate;
|
||||
this.drainRate = drainRate;
|
||||
}
|
||||
|
@ -47,8 +46,8 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 13 && mouseX <= 64 && mouseY >= 27 && mouseY <= 58)
|
||||
{
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.drainRate", drainRate));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.drainRate", drainRate));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
@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");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.armourDowngrade");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
|
@ -88,8 +88,9 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
|
||||
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI)
|
||||
{
|
||||
guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
ingredients.getInputs(ItemStack.class).remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
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;
|
||||
|
@ -8,6 +10,8 @@ import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
|||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
|
@ -20,7 +24,9 @@ public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
|||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
// TODO - inputs
|
||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
expanded.add(Lists.newArrayList(recipe.getKey()));
|
||||
ingredients.setInputLists(ItemStack.class, expanded);
|
||||
ItemStack upgradeStack = new ItemStack(ModItems.UPGRADE_TOME);
|
||||
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
||||
ingredients.setOutput(ItemStack.class, upgradeStack);
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -22,7 +24,7 @@ public class BindingRecipeCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/binding.png"), 0, 0, 100, 30);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.binding");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.binding");
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
|
@ -51,26 +53,23 @@ public class BindingRecipeCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
{
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 73, 5);
|
||||
|
||||
if (recipeWrapper instanceof BindingRecipeJEI)
|
||||
{
|
||||
BindingRecipeJEI bindingRecipe = (BindingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, bindingRecipe.getInputs());
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, bindingRecipe.getCatalyst());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, bindingRecipe.getOutputs());
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
|
|||
return BindingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_BINDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
|
@ -39,6 +31,6 @@ public class BindingRecipeHandler implements IRecipeHandler<BindingRecipeJEI>
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull BindingRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package WayofTime.bloodmagic.compat.jei.binding;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
@ -28,21 +29,9 @@ public class BindingRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
|
||||
public ItemStack getCatalyst()
|
||||
{
|
||||
return catalyst;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
ingredients.setInputLists(ItemStack.class, Lists.newArrayList(inputs, Lists.newArrayList(catalyst)));
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
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.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -27,7 +28,7 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
@Nonnull
|
||||
private final IDrawable background = BloodMagicPlugin.jeiHelper.getGuiHelper().createDrawable(new ResourceLocation(Constants.Mod.DOMAIN + "gui/jei/soulForge.png"), 0, 0, 100, 40);
|
||||
@Nonnull
|
||||
private final String localizedName = TextHelper.localize("jei.BloodMagic.recipe.soulForge");
|
||||
private final String localizedName = TextHelper.localize("jei.bloodmagic.recipe.soulForge");
|
||||
@Nonnull
|
||||
private final ICraftingGridHelper craftingGridHelper;
|
||||
|
||||
|
@ -63,15 +64,15 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
|
@ -87,12 +88,17 @@ public class TartaricForgeRecipeCategory implements IRecipeCategory
|
|||
}
|
||||
}
|
||||
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
List<List<ItemStack>> outputs = ingredients.getOutputs(ItemStack.class);
|
||||
|
||||
if (recipeWrapper instanceof TartaricForgeRecipeJEI)
|
||||
{
|
||||
TartaricForgeRecipeJEI recipe = (TartaricForgeRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(GEM_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 2, 3);
|
||||
guiItemStacks.set(GEM_SLOT, ingredients.getInputs(ItemStack.class).get(ingredients.getInputs(ItemStack.class).size() - 1));
|
||||
inputs.remove(ingredients.getInputs(ItemStack.class).size() - 1);
|
||||
guiItemStacks.set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
guiItemStacks.set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, inputs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeR
|
|||
return TartaricForgeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_SOULFORGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull TartaricForgeRecipeJEI recipe)
|
||||
{
|
||||
|
@ -39,6 +31,6 @@ public class TartaricForgeRecipeHandler implements IRecipeHandler<TartaricForgeR
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull TartaricForgeRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ import java.util.List;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
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;
|
||||
import WayofTime.bloodmagic.api.recipe.TartaricForgeRecipe;
|
||||
|
@ -20,7 +23,7 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
@Getter
|
||||
private TartaricForgeRecipe recipe;
|
||||
@Getter
|
||||
private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
private List<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public TartaricForgeRecipeJEI(TartaricForgeRecipe recipe)
|
||||
{
|
||||
|
@ -32,20 +35,11 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<Collection> getInputs()
|
||||
{
|
||||
ArrayList<Collection> ret = new ArrayList<Collection>();
|
||||
ret.add(recipe.getInput());
|
||||
ret.add(validGems);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(recipe.getRecipeOutput());
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
List<List<ItemStack>> expandedInputs = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||
expandedInputs.add(validGems);
|
||||
ingredients.setInputLists(ItemStack.class, expandedInputs);
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -55,8 +49,8 @@ public class TartaricForgeRecipeJEI extends BlankRecipeWrapper
|
|||
ArrayList<String> ret = new ArrayList<String>();
|
||||
if (mouseX >= 40 && mouseX <= 60 && mouseY >= 21 && mouseY <= 34)
|
||||
{
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.soulsDrained", recipe.getSoulsDrained()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.minimumSouls", recipe.getMinimumSouls()));
|
||||
ret.add(TextHelper.localize("jei.bloodmagic.recipe.soulsDrained", recipe.getSoulsDrained()));
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -19,14 +19,6 @@ public class ShapedOrbRecipeHandler implements IRecipeHandler<ShapedBloodOrbReci
|
|||
return ShapedBloodOrbRecipe.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public String getRecipeCategoryUid(@Nonnull ShapedBloodOrbRecipe recipe)
|
||||
{
|
||||
|
|
|
@ -2,21 +2,21 @@ 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.IShapedCraftingRecipeWrapper;
|
||||
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 ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper
|
||||
public class ShapedOrbRecipeJEI extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
|
@ -54,52 +54,15 @@ public class ShapedOrbRecipeJEI implements IShapedCraftingRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return inputs;
|
||||
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 List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(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));
|
||||
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());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,14 +17,6 @@ public class ShapelessOrbRecipeHandler implements IRecipeHandler<ShapelessBloodO
|
|||
return ShapelessBloodOrbRecipe.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull ShapelessBloodOrbRecipe recipe)
|
||||
{
|
||||
|
|
|
@ -8,7 +8,10 @@ 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;
|
||||
|
@ -16,14 +19,12 @@ import net.minecraftforge.fluids.FluidStack;
|
|||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper
|
||||
public class ShapelessOrbRecipeJEI extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
||||
{
|
||||
|
||||
@Nonnull
|
||||
private final List inputs;
|
||||
|
||||
private final int tier;
|
||||
|
||||
@Nonnull
|
||||
private final ItemStack output;
|
||||
|
||||
|
@ -42,52 +43,16 @@ public class ShapelessOrbRecipeJEI implements ICraftingRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
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));
|
||||
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());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleClick(@Nonnull Minecraft minecraft, int mouseX, int mouseY, int mouseButton)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue