Fix Alchemy Table JEI compat being fundamentally wrong (#1069)
This commit is contained in:
parent
719cff06e1
commit
fedea85993
|
@ -1,24 +1,21 @@
|
||||||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||||
import mezz.jei.api.gui.IDrawable;
|
import mezz.jei.api.gui.IDrawable;
|
||||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||||
import mezz.jei.api.gui.IRecipeLayout;
|
import mezz.jei.api.gui.IRecipeLayout;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.IRecipeCategory;
|
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import WayofTime.bloodmagic.api.Constants;
|
import WayofTime.bloodmagic.api.Constants;
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||||
|
|
||||||
public class AlchemyTableRecipeCategory implements IRecipeCategory
|
public class AlchemyTableRecipeCategory extends BlankRecipeCategory<AlchemyTableRecipeJEI>
|
||||||
{
|
{
|
||||||
private static final int OUTPUT_SLOT = 0;
|
private static final int OUTPUT_SLOT = 0;
|
||||||
private static final int ORB_SLOT = 1;
|
private static final int ORB_SLOT = 1;
|
||||||
|
@ -58,21 +55,7 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawExtras(Minecraft minecraft)
|
public void setRecipe(IRecipeLayout recipeLayout, AlchemyTableRecipeJEI recipeWrapper, IIngredients ingredients)
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
|
||||||
public IDrawable getIcon()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
|
||||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
|
||||||
{
|
{
|
||||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||||
|
|
||||||
|
@ -88,21 +71,8 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeWrapper instanceof AlchemyTableRecipeJEI)
|
guiItemStacks.set(ORB_SLOT, OrbRegistry.getOrbsDownToTier(recipeWrapper.getRecipe().getTierRequired()));
|
||||||
{
|
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class));
|
||||||
guiItemStacks.set(ORB_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||||
craftingGridHelper.setOutput(guiItemStacks, Lists.newArrayList(ingredients.getOutputs(ItemStack.class).get(0)));
|
|
||||||
craftingGridHelper.setInputStacks(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawAnimations(Minecraft minecraft) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||||
|
@ -25,7 +26,7 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||||
public void getIngredients(IIngredients ingredients) {
|
public void getIngredients(IIngredients ingredients) {
|
||||||
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
List<List<ItemStack>> expanded = BloodMagicPlugin.jeiHelper.getStackHelper().expandRecipeItemStackInputs(recipe.getInput());
|
||||||
ingredients.setInputLists(ItemStack.class, expanded);
|
ingredients.setInputLists(ItemStack.class, expanded);
|
||||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(new ArrayList<ItemStack>()));
|
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(Lists.<ItemStack>newArrayList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,6 +35,7 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||||
ArrayList<String> ret = new ArrayList<String>();
|
ArrayList<String> ret = new ArrayList<String>();
|
||||||
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
|
if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
|
||||||
{
|
{
|
||||||
|
ret.add(TextHelper.localize("tooltip.BloodMagic.tier", recipe.getTierRequired()));
|
||||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
|
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.ticksRequired", recipe.getTicksRequired()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue