update JEI to 3.11.+
the ingredients overhaul
This commit is contained in:
@@ -4,6 +4,7 @@ import mezz.jei.api.IGuiHelper;
|
||||
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;
|
||||
@@ -66,4 +67,28 @@ public class RecipeCategorySolderer implements IRecipeCategory {
|
||||
group.set(3, (ItemStack) recipeWrapper.getOutputs().get(0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients) {
|
||||
IGuiItemStackGroup group = recipeLayout.getItemStacks();
|
||||
|
||||
int x = 44 - 9;
|
||||
int y = 20 - 6;
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
group.init(i, true, x, y);
|
||||
|
||||
y += 18;
|
||||
}
|
||||
|
||||
group.init(3, false, 127 - 9, 38 - 6);
|
||||
|
||||
if (recipeWrapper instanceof RecipeWrapperSolderer) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
group.set(i, ingredients.getInputs(ItemStack.class).get(i));
|
||||
}
|
||||
|
||||
group.set(3, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package refinedstorage.integration.jei;
|
||||
|
||||
import mezz.jei.plugins.vanilla.VanillaRecipeWrapper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class RecipeWrapperSolderer extends VanillaRecipeWrapper {
|
||||
public class RecipeWrapperSolderer extends BlankRecipeWrapper {
|
||||
private List<ItemStack> inputs;
|
||||
private ItemStack output;
|
||||
|
||||
@@ -15,6 +16,12 @@ public class RecipeWrapperSolderer extends VanillaRecipeWrapper {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getInputs() {
|
||||
return inputs;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package refinedstorage.integration.jei;
|
||||
|
||||
import mezz.jei.api.IJeiRuntime;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import refinedstorage.RefinedStorageBlocks;
|
||||
|
||||
@JEIPlugin
|
||||
public class RefinedStorageJEIPlugin implements IModPlugin {
|
||||
public class RefinedStorageJEIPlugin extends BlankModPlugin {
|
||||
public static RefinedStorageJEIPlugin INSTANCE;
|
||||
|
||||
private IJeiRuntime runtime;
|
||||
|
||||
Reference in New Issue
Block a user