updating recipe category, trying to render input slots
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
package nmd.primal.forgecraft.compat.JEI.crucible;
|
package nmd.primal.forgecraft.compat.JEI.crucible;
|
||||||
|
|
||||||
|
import crafttweaker.api.item.IngredientAny;
|
||||||
import mezz.jei.api.IGuiHelper;
|
import mezz.jei.api.IGuiHelper;
|
||||||
import mezz.jei.api.gui.*;
|
import mezz.jei.api.gui.*;
|
||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import nmd.primal.core.common.compat.jei.AbstractCategory;
|
import nmd.primal.core.common.compat.jei.AbstractCategory;
|
||||||
import nmd.primal.core.common.helper.CommonUtils;
|
import nmd.primal.core.common.helper.CommonUtils;
|
||||||
@@ -65,6 +68,7 @@ public class CrucibleRecipeCategory extends AbstractCategory<CrucibleRecipeWrapp
|
|||||||
//IGuiFluidStackGroup fluids = layout.getFluidStacks();
|
//IGuiFluidStackGroup fluids = layout.getFluidStacks();
|
||||||
IGuiItemStackGroup items = layout.getItemStacks();
|
IGuiItemStackGroup items = layout.getItemStacks();
|
||||||
|
|
||||||
|
|
||||||
// input fluid
|
// input fluid
|
||||||
//fluids.init(0, true, 6, 8, 13, 48, 4000, true, null);
|
//fluids.init(0, true, 6, 8, 13, 48, 4000, true, null);
|
||||||
//fluids.set(ingredients);
|
//fluids.set(ingredients);
|
||||||
@@ -76,12 +80,18 @@ public class CrucibleRecipeCategory extends AbstractCategory<CrucibleRecipeWrapp
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
// input items
|
// input items
|
||||||
items.init(0, true, 31, 18);
|
items.init(0, true, 0, 18);
|
||||||
items.init(1, true, 50, 18);
|
items.init(1, true, 10, 18);
|
||||||
items.init(2, true, 31, 37);
|
items.init(2, true, 20, 18);
|
||||||
items.init(3, true, 50, 37);
|
items.init(3, true, 30, 18);
|
||||||
|
items.init(4, true, 50, 18);
|
||||||
|
|
||||||
//items.set(0, recipe.item_input_1);
|
|
||||||
|
items.set(0, recipe.getIngredient(0));
|
||||||
|
items.set(1, recipe.getIngredient(1));
|
||||||
|
items.set(2, recipe.getIngredient(2));
|
||||||
|
items.set(3, recipe.getIngredient(3));
|
||||||
|
items.set(4, recipe.getIngredient(4));
|
||||||
//items.set(1, recipe.item_input_2);
|
//items.set(1, recipe.item_input_2);
|
||||||
//items.set(2, recipe.item_input_3);
|
//items.set(2, recipe.item_input_3);
|
||||||
//items.set(3, recipe.item_input_4);
|
//items.set(3, recipe.item_input_4);
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import nmd.primal.forgecraft.crafting.CrucibleCrafting;
|
import nmd.primal.forgecraft.crafting.CrucibleCrafting;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -32,8 +35,9 @@ public class CrucibleRecipeWrapper implements IRecipeWrapper
|
|||||||
protected Ingredient ing3;
|
protected Ingredient ing3;
|
||||||
protected Ingredient ing4;
|
protected Ingredient ing4;
|
||||||
|
|
||||||
protected List crucibleCrafting;
|
protected List<Ingredient> ingredientList;
|
||||||
|
|
||||||
|
protected List crucibleCrafting;
|
||||||
|
|
||||||
public CrucibleRecipeWrapper(CrucibleCrafting recipe)
|
public CrucibleRecipeWrapper(CrucibleCrafting recipe)
|
||||||
{
|
{
|
||||||
@@ -51,6 +55,7 @@ public class CrucibleRecipeWrapper implements IRecipeWrapper
|
|||||||
this.ing3 = recipe.getIng3();
|
this.ing3 = recipe.getIng3();
|
||||||
this.ing4 = recipe.getIng4();
|
this.ing4 = recipe.getIng4();
|
||||||
|
|
||||||
|
this.ingredientList = recipe.getIngredientList();
|
||||||
this.crucibleCrafting = recipe.getIngredientList();
|
this.crucibleCrafting = recipe.getIngredientList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,10 +71,17 @@ public class CrucibleRecipeWrapper implements IRecipeWrapper
|
|||||||
ingredients.setOutput(ItemStack.class, this.dropsCooked);
|
ingredients.setOutput(ItemStack.class, this.dropsCooked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ItemStack> getIngredient(int a){
|
||||||
|
|
||||||
|
ItemStack[] tempArray = this.ingredientList.get(a).getMatchingStacks();
|
||||||
|
List<ItemStack> stackList = Arrays.asList(tempArray);
|
||||||
|
return stackList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY)
|
||||||
{
|
{
|
||||||
minecraft.fontRenderer.drawString(String.valueOf(cookTime), 80, 48, Color.gray.getRGB());
|
minecraft.fontRenderer.drawString(String.valueOf("Cook time: " + cookTime), 60, 50, Color.red.getRGB());
|
||||||
minecraft.fontRenderer.drawString(String.valueOf(cookTemp), 80, 38, Color.gray.getRGB());
|
minecraft.fontRenderer.drawString(String.valueOf("Cook temp: " + cookTemp), 60, 10, Color.green.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public class ModCrafting{
|
|||||||
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
RecipeHandler.addSmelting(ModItems.softcrucible, new ItemStack(ModBlocks.nbtCrucible, 1));
|
//RecipeHandler.addSmelting(ModItems.softcrucible, new ItemStack(ModBlocks.nbtCrucible, 1));
|
||||||
|
|
||||||
/***********************/
|
/***********************/
|
||||||
/***CRUCIBLE CRAFTING***/
|
/***CRUCIBLE CRAFTING***/
|
||||||
|
|||||||
Reference in New Issue
Block a user