use of minetweaker.api.item.IItemStack in project Minechem by iopleke.
the class InputHelper method getInputs.
public static ArrayList<ItemStack> getInputs(IIngredient input) {
ArrayList<ItemStack> toAdd = new ArrayList<ItemStack>();
if (input instanceof IOreDictEntry) {
for (ItemStack inStack : OreDictionary.getOres(((IOreDictEntry) input).getName())) {
ItemStack result = inStack.copy();
result.stackSize = input.getAmount();
toAdd.add(result);
}
} else if (input instanceof IItemStack) {
toAdd.add(InputHelper.toStack((IItemStack) input));
}
return toAdd;
}
use of minetweaker.api.item.IItemStack in project Minechem by iopleke.
the class InputHelper method getInput.
public static ItemStack getInput(IIngredient input) {
if (input == null) {
return null;
}
if (input instanceof IOreDictEntry) {
ItemStack result = OreDictionary.getOres(((IOreDictEntry) input).getName()).get(0).copy();
result.stackSize = input.getAmount();
return result;
} else if (input instanceof IngredientStack) {
ItemStack result = toStack(input.getItems().get(0));
result.stackSize = input.getAmount();
return result;
} else if (input instanceof IItemStack) {
return toStack((IItemStack) input);
}
return null;
}
Aggregations