crucible recipe manager is working
This commit is contained in:
@@ -20,6 +20,7 @@ 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.CrucibleCrafting;
|
||||||
import nmd.primal.forgecraft.init.ModBlocks;
|
import nmd.primal.forgecraft.init.ModBlocks;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import nmd.primal.forgecraft.ModInfo;
|
import nmd.primal.forgecraft.ModInfo;
|
||||||
import nmd.primal.forgecraft.crafting.CrucibleHandler;
|
|
||||||
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
|
import nmd.primal.forgecraft.tiles.TileBaseCrucible;
|
||||||
import nmd.primal.forgecraft.tiles.TileNBTCrucible;
|
import nmd.primal.forgecraft.tiles.TileNBTCrucible;
|
||||||
|
|
||||||
@@ -50,9 +49,7 @@ public class NBTCrucible extends Block implements ITileEntityProvider {
|
|||||||
if (!world.isRemote) {
|
if (!world.isRemote) {
|
||||||
TileNBTCrucible tile = (TileNBTCrucible) world.getTileEntity(pos);
|
TileNBTCrucible tile = (TileNBTCrucible) world.getTileEntity(pos);
|
||||||
ItemStack pItem = player.inventory.getCurrentItem();
|
ItemStack pItem = player.inventory.getCurrentItem();
|
||||||
if(CrucibleHandler.getCrucibleIngredients().apply(pItem)){
|
|
||||||
System.out.println("true");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package nmd.primal.forgecraft.crafting;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import javax.annotation.Nullable;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mminaie on 11/11/17.
|
* Created by mminaie on 11/11/17.
|
||||||
@@ -23,7 +23,122 @@ public class CrucibleCrafting {
|
|||||||
private Ingredient ing3;
|
private Ingredient ing3;
|
||||||
private Ingredient ing4;
|
private Ingredient ing4;
|
||||||
|
|
||||||
private List<Ingredient> ingredientList;
|
private List<Ingredient> ingredientList = new List<Ingredient>() {
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean contains(Object o) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<Ingredient> iterator() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object[] toArray() {
|
||||||
|
return new Object[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T[] toArray(T[] a) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean add(Ingredient ingredient) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean remove(Object o) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsAll(Collection<?> c) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addAll(Collection<? extends Ingredient> c) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addAll(int index, Collection<? extends Ingredient> c) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean removeAll(Collection<?> c) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean retainAll(Collection<?> c) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ingredient get(int index) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ingredient set(int index, Ingredient element) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void add(int index, Ingredient element) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Ingredient remove(int index) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int indexOf(Object o) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int lastIndexOf(Object o) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListIterator<Ingredient> listIterator() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ListIterator<Ingredient> listIterator(int index) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Ingredient> subList(int fromIndex, int toIndex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private ItemStack drops;
|
private ItemStack drops;
|
||||||
|
|
||||||
@@ -66,4 +181,17 @@ public class CrucibleCrafting {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isValidIngredient(ItemStack checkStack){
|
||||||
|
for(CrucibleCrafting recipe : crucibleCrafting) {
|
||||||
|
if (recipe.ing0.apply(checkStack) ||
|
||||||
|
recipe.ing1.apply(checkStack) ||
|
||||||
|
recipe.ing2.apply(checkStack) ||
|
||||||
|
recipe.ing3.apply(checkStack) ||
|
||||||
|
recipe.ing4.apply(checkStack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ 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.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;
|
||||||
@@ -22,7 +23,12 @@ 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"),
|
||||||
|
Ingredient.EMPTY,
|
||||||
|
Ingredient.EMPTY,
|
||||||
|
Ingredient.EMPTY,
|
||||||
|
Ingredient.EMPTY,
|
||||||
new ItemStack(ModBlocks.ironball, 1));
|
new ItemStack(ModBlocks.ironball, 1));
|
||||||
|
|
||||||
/***CASTING BLOCK***/
|
/***CASTING BLOCK***/
|
||||||
|
|||||||
Reference in New Issue
Block a user