got ingredient recipe

This commit is contained in:
Mohammad-Ali Minaie
2017-11-16 22:04:44 -05:00
parent 37ab61a195
commit 4fd1da1215
3 changed files with 75 additions and 136 deletions

View File

@@ -0,0 +1,72 @@
package nmd.primal.forgecraft.crafting;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.oredict.OreDictionary;
import nmd.primal.core.api.PrimalAPI;
import nmd.primal.core.common.recipes.RecipeHandler;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import java.util.*;
/**
* Created by mminaie on 11/11/17.
*/
public class CrucibleCrafting {
// ***************************************************************************** //
// Recipe Handler CrucibleHandler
// ***************************************************************************** //
private static ArrayList<CrucibleCrafting> crucibleCrafting = new ArrayList<>();
private Ingredient ing0;
private Ingredient ing1;
private Ingredient ing2;
private Ingredient ing3;
private Ingredient ing4;
private List<Ingredient> ingredientList;
public CrucibleCrafting(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4){
this.ing0 = i0;
this.ing1 = i1;
this.ing2 = i2;
this.ing3 = i3;
this.ing4 = i4;
this.ingredientList.add(0, i0);
this.ingredientList.add(1, i1);
this.ingredientList.add(2, i2);
this.ingredientList.add(3, i3);
this.ingredientList.add(4, i4);
}
public static void addRecipe(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4)
{
crucibleCrafting.add(new CrucibleCrafting(i0, i1, i2, i3, i4));
}
//CustomIngredient(String ore, ItemStack... stacks)
/*private Ingredient ingredient;
public CrucibleCrafting(Ingredient input){
this.ingredient = input;
}
public static void addIngredient(Ingredient input){
crucibleChecking.add(new CrucibleCrafting(input));
}*/
}

View File

@@ -1,127 +0,0 @@
package nmd.primal.forgecraft.crafting;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.oredict.OreDictionary;
import nmd.primal.core.api.PrimalAPI;
import nmd.primal.core.common.recipes.RecipeHandler;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
/**
* Created by mminaie on 11/11/17.
*/
public class CrucibleHandler {
private static Ingredient crucibleIngredients;
/***ALLOWED CRUCIBLE ITEMS***/
//crucibleIngredients.apply(new ItemStack(Blocks.IRON_ORE, 1));
public static Ingredient getCrucibleIngredients() {
return crucibleIngredients;
}
public static void setCrucibleIngredients(Ingredient crucibleIngredients) {
crucibleIngredients = crucibleIngredients;
}
/*
/***RAW CRUCIBLES
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawironcrucible),
"X","Y",
('X'), "oreIron",
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawcleanironcrucible),
"XL","Y ",
('X'), "dustIron",
('L'), PrimalAPI.Items.CARBONATE_SLACK,
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawsteelcrucible),
"XC","Y ",
('X'), new ItemStack(ModBlocks.ironcleanball, 1),
('C'), new ItemStack(PrimalAPI.Items.CHARCOAL_HIGH),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"XCX"," X "," Y ",
('X'), "dustCopper",
('C'), "dustTin",
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"XXX"," X "," Y ",
('X'), "nuggetBronze",
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"X","Y",
('X'), new ItemStack(ModItems.bronzepickaxehead, 1,OreDictionary.WILDCARD_VALUE),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"X","Y",
('X'), new ItemStack(ModItems.bronzeaxehead, 1, OreDictionary.WILDCARD_VALUE),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"X","Y",
('X'), new ItemStack(ModItems.bronzeshovelhead, 1, OreDictionary.WILDCARD_VALUE),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"X","Y",
('X'), new ItemStack(ModItems.bronzehoehead, 1, OreDictionary.WILDCARD_VALUE),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible),
"X","Y",
('X'), new ItemStack(ModItems.bronzegladius, 1, OreDictionary.WILDCARD_VALUE),
('Y'), ModBlocks.emptycrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible_redstone),
"R","Y",
('R'), Items.REDSTONE,
('Y'), ModBlocks.rawbronzecrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible_diamond),
"D","Y",
('D'), PrimalAPI.Items.DIAMOND_KNAPP,
('Y'), ModBlocks.rawbronzecrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible_lapis),
"L","Y",
('L'), new ItemStack(Items.DYE, 1, 4),
('Y'), ModBlocks.rawbronzecrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible_emerald),
"E","Y",
('E'), PrimalAPI.Items.EMERALD_KNAPP,
('Y'), ModBlocks.rawbronzecrucible);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawbronzecrucible, 1),
"T", "Y",
('T'), new ItemStack(ModItems.brokenbronzetool, 1),
('Y'), new ItemStack(ModBlocks.emptycrucible, 1)
);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawironcrucible, 1),
"T", "Y",
('T'), new ItemStack(ModItems.brokenwroughtirontool, 1),
('Y'), new ItemStack(ModBlocks.emptycrucible, 1)
);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawcleanironcrucible, 1),
"T", "Y",
('T'), new ItemStack(ModItems.brokencleanirontool, 1),
('Y'), new ItemStack(ModBlocks.emptycrucible, 1)
);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawsteelcrucible, 1),
"T", "Y",
('T'), new ItemStack(ModItems.brokensteeltool, 1),
('Y'), new ItemStack(ModBlocks.emptycrucible, 1)
);
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawwootzcrucible, 1),
"T", "Y",
('T'), new ItemStack(ModItems.brokenwootztool, 1),
('Y'), new ItemStack(ModBlocks.emptycrucible, 1)
);
*/
}

View File

@@ -5,6 +5,7 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient; import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.advancements.critereon.OredictItemPredicate;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.OreIngredient; import net.minecraftforge.oredict.OreIngredient;
import nmd.primal.core.api.PrimalAPI; import nmd.primal.core.api.PrimalAPI;
@@ -12,7 +13,7 @@ import nmd.primal.core.common.helper.CommonUtils;
import nmd.primal.core.common.recipes.RecipeHandler; import nmd.primal.core.common.recipes.RecipeHandler;
import nmd.primal.forgecraft.crafting.*; import nmd.primal.forgecraft.crafting.*;
import nmd.primal.forgecraft.crafting.CrucibleHandler; import nmd.primal.forgecraft.crafting.CrucibleCrafting;
import java.util.Random; import java.util.Random;
/** /**
@@ -24,14 +25,7 @@ public class ModCrafting{
Random rand = new Random(); Random rand = new Random();
CrucibleCrafting.addRecipe(new OreIngredient("oreIron"), null, null, null, null);
CrucibleHandler.setCrucibleIngredients(new OreIngredient("oreIron"));
CrucibleHandler.setCrucibleIngredients(new OreIngredient("dustIron"));
CrucibleHandler.setCrucibleIngredients(new OreIngredient("dustTin"));
CrucibleHandler.setCrucibleIngredients(new OreIngredient("dustCopper"));
//CrucibleHandler.setCrucibleIngredients();
//.fromItems(PrimalAPI.Items.CARBONATE_SLACK, PrimalAPI.Items.CHARCOAL_HIGH));
/***CASTING BLOCK***/ /***CASTING BLOCK***/
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.castingblock), RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.castingblock),