use of crafttweaker.api.item.IItemStack in project Binnie by ForestryMC.
the class FruitPressRecipeHandler method addRecipe.
@ZenMethod
public static void addRecipe(IItemStack input, ILiquidStack output) {
ItemStack inputStack = CraftTweakerUtil.getItemStack(input);
FluidStack outputStack = CraftTweakerUtil.getLiquidStack(output);
addRecipe(new FruitPressRecipe(inputStack, outputStack), ExtraTreesRecipeManager.fruitPressManager);
}
use of crafttweaker.api.item.IItemStack in project ImmersiveEngineering by BluSunrize.
the class MetalPress method addRecipe.
@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input, IItemStack mold, int energy, @Optional int inputSize) {
Object oInput = CraftTweakerHelper.toObject(input);
if (oInput == null)
return;
ItemStack sOut = CraftTweakerHelper.toStack(output);
ItemStack sMold = CraftTweakerHelper.toStack(mold);
if (!sOut.isEmpty() && !sMold.isEmpty()) {
MetalPressRecipe r = new MetalPressRecipe(sOut, oInput, ApiUtils.createComparableItemStack(sMold, true), energy);
if (inputSize > 0)
r.setInputSize(inputSize);
CraftTweakerAPI.apply(new Add(r));
}
}
use of crafttweaker.api.item.IItemStack in project GregTech by GregTechCE.
the class RecipeMap method ctFindRecipe.
@ZenMethod("findRecipe")
@Method(modid = GTValues.MODID_CT)
@Nullable
public CTRecipe ctFindRecipe(long maxVoltage, IItemStack[] itemInputs, ILiquidStack[] fluidInputs, @Optional(valueLong = Integer.MAX_VALUE) int outputFluidTankCapacity) {
List<ItemStack> mcItemInputs = itemInputs == null ? Collections.emptyList() : Arrays.stream(itemInputs).map(CraftTweakerMC::getItemStack).collect(Collectors.toList());
List<FluidStack> mcFluidInputs = fluidInputs == null ? Collections.emptyList() : Arrays.stream(fluidInputs).map(CraftTweakerMC::getLiquidStack).collect(Collectors.toList());
Recipe backingRecipe = findRecipe(maxVoltage, mcItemInputs, mcFluidInputs, outputFluidTankCapacity);
return backingRecipe == null ? null : new CTRecipe(this, backingRecipe);
}
use of crafttweaker.api.item.IItemStack in project BetterWithAddons by DaedalusGame.
the class Packing method add.
@ZenMethod
public static void add(IItemStack output, IIngredient input) {
ItemStack stack = CraftTweakerMC.getItemStack(output);
if (stack.getItem() instanceof ItemBlock) {
Block block = ((ItemBlock) stack.getItem()).getBlock();
PackingRecipe r = new PackingRecipe(new IngredientCraftTweaker(input), block.getStateFromMeta(stack.getMetadata()));
r.setJeiOutput(stack);
CraftTweaker.LATE_ACTIONS.add(new Add(r));
}
}
use of crafttweaker.api.item.IItemStack in project Charset by CharsetMC.
the class MaterialRegistry method registerTypes.
@ZenMethod
public static boolean registerTypes(IItemStack stack, String... tags) {
ItemStack mcStack = CraftTweakerMC.getItemStack(stack);
if (mcStack.isEmpty()) {
return false;
}
CraftTweakerAPI.apply(new IAction() {
@Override
public void apply() {
ItemMaterial material = ItemMaterialRegistry.INSTANCE.getOrCreateMaterial(mcStack);
ItemMaterialRegistry.INSTANCE.registerTypes(material, tags);
}
@Override
public String describe() {
return "Registering stack " + stack + " as material with types " + JOINER.join(tags);
}
});
return true;
}
Aggregations