fixed the crucible crafting
This commit is contained in:
@@ -20,7 +20,6 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||||||
import nmd.primal.core.api.PrimalAPI;
|
import nmd.primal.core.api.PrimalAPI;
|
||||||
import nmd.primal.forgecraft.CommonUtils;
|
import nmd.primal.forgecraft.CommonUtils;
|
||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
import nmd.primal.forgecraft.crafting.CrucibleHandler;
|
|
||||||
import nmd.primal.forgecraft.init.ModBlocks;
|
import nmd.primal.forgecraft.init.ModBlocks;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@@ -51,9 +50,6 @@ public class Crucible extends Block {
|
|||||||
|
|
||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
ItemStack pItem = player.inventory.getCurrentItem();
|
ItemStack pItem = player.inventory.getCurrentItem();
|
||||||
if(CrucibleHandler.getCrucibleIngredients().apply(pItem)){
|
|
||||||
System.out.println("true");
|
|
||||||
}
|
|
||||||
if(pItem.isEmpty()){
|
if(pItem.isEmpty()){
|
||||||
CommonUtils.spawnItemEntity(world, player, new ItemStack(this, 1));
|
CommonUtils.spawnItemEntity(world, player, new ItemStack(this, 1));
|
||||||
world.setBlockToAir(pos);
|
world.setBlockToAir(pos);
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package nmd.primal.forgecraft.blocks.Crucibles;
|
package nmd.primal.forgecraft.blocks.Crucibles;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockDynamicLiquid;
|
|
||||||
import net.minecraft.block.ITileEntityProvider;
|
import net.minecraft.block.ITileEntityProvider;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
|
||||||
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.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package nmd.primal.forgecraft.crafting;
|
package nmd.primal.forgecraft.crafting;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
package nmd.primal.forgecraft.crafting;
|
package nmd.primal.forgecraft.crafting;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.init.Items;
|
|
||||||
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.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.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mminaie on 11/11/17.
|
* Created by mminaie on 11/11/17.
|
||||||
@@ -31,8 +25,10 @@ public class CrucibleCrafting {
|
|||||||
|
|
||||||
private List<Ingredient> ingredientList;
|
private List<Ingredient> ingredientList;
|
||||||
|
|
||||||
|
private ItemStack drops;
|
||||||
|
|
||||||
public CrucibleCrafting(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4){
|
|
||||||
|
public CrucibleCrafting(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4, ItemStack output){
|
||||||
|
|
||||||
this.ing0 = i0;
|
this.ing0 = i0;
|
||||||
this.ing1 = i1;
|
this.ing1 = i1;
|
||||||
@@ -44,29 +40,30 @@ public class CrucibleCrafting {
|
|||||||
this.ingredientList.add(2, i2);
|
this.ingredientList.add(2, i2);
|
||||||
this.ingredientList.add(3, i3);
|
this.ingredientList.add(3, i3);
|
||||||
this.ingredientList.add(4, i4);
|
this.ingredientList.add(4, i4);
|
||||||
|
this.drops = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addRecipe(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4)
|
public static void addRecipe(Ingredient i0, Ingredient i1, Ingredient i2, Ingredient i3, Ingredient i4, ItemStack drop)
|
||||||
{
|
{
|
||||||
crucibleCrafting.add(new CrucibleCrafting(i0, i1, i2, i3, i4));
|
crucibleCrafting.add(new CrucibleCrafting(i0, i1, i2, i3, i4, drop));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isRecipe(ItemStack i0, ItemStack i1, ItemStack i2, ItemStack i3, ItemStack i4){
|
||||||
|
for(CrucibleCrafting recipe : crucibleCrafting){
|
||||||
//CustomIngredient(String ore, ItemStack... stacks)
|
if(recipe.ing0.apply(i0) && recipe.ing1.apply(i1) && recipe.ing2.apply(i2) && recipe.ing3.apply(i3) && recipe.ing4.apply(i4) ){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
/*private Ingredient ingredient;
|
}
|
||||||
|
return false;
|
||||||
|
|
||||||
public CrucibleCrafting(Ingredient input){
|
|
||||||
this.ingredient = input;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addIngredient(Ingredient input){
|
public static CrucibleCrafting getRecipe(ItemStack i0, ItemStack i1, ItemStack i2, ItemStack i3, ItemStack i4){
|
||||||
crucibleChecking.add(new CrucibleCrafting(input));
|
for(CrucibleCrafting recipe : crucibleCrafting){
|
||||||
}*/
|
if(recipe.ing0.apply(i0) && recipe.ing1.apply(i1) && recipe.ing2.apply(i2) && recipe.ing3.apply(i3) && recipe.ing4.apply(i4) ){
|
||||||
|
return recipe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import net.minecraft.init.Blocks;
|
|||||||
import net.minecraft.init.Items;
|
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.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;
|
||||||
@@ -13,7 +11,6 @@ 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.CrucibleCrafting;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,7 +22,8 @@ public class ModCrafting{
|
|||||||
|
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
CrucibleCrafting.addRecipe(new OreIngredient("oreIron"), null, null, null, null);
|
CrucibleCrafting.addRecipe(new OreIngredient("oreIron"), null, null, null, null,
|
||||||
|
new ItemStack(ModBlocks.ironball, 1));
|
||||||
|
|
||||||
/***CASTING BLOCK***/
|
/***CASTING BLOCK***/
|
||||||
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.castingblock),
|
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.castingblock),
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package nmd.primal.forgecraft.items;
|
package nmd.primal.forgecraft.items;
|
||||||
|
|
||||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
|
||||||
import net.minecraft.client.util.ITooltipFlag;
|
import net.minecraft.client.util.ITooltipFlag;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
package nmd.primal.forgecraft.tiles;
|
package nmd.primal.forgecraft.tiles;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.ITickable;
|
import net.minecraft.util.ITickable;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import nmd.primal.forgecraft.crafting.BloomeryCrafting;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mminaie on 11/11/17.
|
* Created by mminaie on 11/11/17.
|
||||||
|
|||||||
Reference in New Issue
Block a user