本文整理汇总了Java中crafttweaker.api.item.IItemStack类的典型用法代码示例。如果您正苦于以下问题:Java IItemStack类的具体用法?Java IItemStack怎么用?Java IItemStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IItemStack类属于crafttweaker.api.item包,在下文中一共展示了IItemStack类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRecipe
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static void addRecipe(String name, IItemStack input, IItemStack output, List<AssemblyRecipe> list) {
if(input == null || output == null) {
Helper.logError(String.format("Required parameters missing for %s Recipe.", name));
return;
}
CraftTweaker.ADDITIONS.add(new Add(name, new AssemblyRecipe(Helper.toStack(input), Helper.toStack(output)), list));
}
示例2: toInput
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static Object[] toInput(IIngredient[] input) {
@SuppressWarnings("rawtypes")
List inputs = new ArrayList();
for(int i = 0; i < input.length; i++) {
if(input[i] instanceof IOreDictEntry) {
inputs.add(toPair((IOreDictEntry)input[i]));
} else if(input[i] instanceof IItemStack) {
inputs.add(toStack((IItemStack)input[i]));
}
}
return inputs.toArray(new Object[inputs.size()]);
}
示例3: toStack
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static ItemStack toStack(IItemStack iStack) {
if(iStack == null) {
return ItemStack.EMPTY;
} else {
Object internal = iStack.getInternal();
if(!(internal instanceof ItemStack)) {
logError("Not a valid item stack: " + iStack);
}
return (ItemStack) internal;
}
}
示例4: toIItemStack
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static IItemStack toIItemStack(ItemStack stack) {
if(stack.isEmpty()) {
return null;
}
return new MCItemStack(stack);
}
示例5: matches
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static boolean matches(IIngredient ingredient, IItemStack itemStack) {
if(ingredient == null) {
return false;
}
return ingredient.matches(itemStack);
}
示例6: add
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void add(IItemStack output, ILiquidStack liquid, @NotNull IItemStack stamp, @Optional IItemStack input) {
ItemStack stack = InputHelper.toStack(input);
ItemStack stampStack = InputHelper.toStack(stamp); //This is pointless but also the easiest way.
ItemStampingRecipe recipe = new ItemStampingRecipe(stack,InputHelper.toFluid(liquid), EnumStampType.getType(stampStack),InputHelper.toStack(output),stack.getMetadata() != OreDictionary.WILDCARD_VALUE,stack.hasTagCompound());
CraftTweakerAPI.apply(new Add(recipe));
}
示例7: add
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void add(IItemStack output,@NotNull IItemStack[] input, int ironMin, int ironMax, int copperMin, int copperMax, int leadMin, int leadMax, int silverMin, int silverMax, int dawnstoneMin, int dawnstoneMax) {
AlchemyRecipe recipe = new AlchemyRecipe(ironMin,ironMax,
dawnstoneMin,dawnstoneMax,
copperMin,copperMax,
silverMin,silverMax,
leadMin,leadMax,
InputHelper.toStack(input[0]),InputHelper.toStack(input[1]),InputHelper.toStack(input[2]),InputHelper.toStack(input[3]),InputHelper.toStack(input[4]),
InputHelper.toStack(output));
CraftTweakerAPI.apply(new Add(recipe));
}
示例8: requireItem
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
private void requireItem(MachineComponent.IOType ioType, IItemStack stack) {
ItemStack mcStack = CraftTweakerMC.getItemStack(stack);
if(mcStack.isEmpty()) {
CraftTweakerAPI.logError("Itemstack not found/unknown item: " + stack.toString());
return;
}
ComponentRequirement.RequirementItem ri = new ComponentRequirement.RequirementItem(ioType, mcStack);
if(stack.getTag().length() > 0) {
ri.tag = CraftTweakerMC.getNBTCompound(stack.getTag());
ri.previewDisplayTag = CraftTweakerMC.getNBTCompound(stack.getTag());
}
appendComponent(ri);
}
示例9: addShaped
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addShaped(IItemStack output, IIngredient[][] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action)
{
ShapedRecipe recipe = new ShapedRecipe(output, ingredients, function, action, false);
IRecipe irecipe = RecipeConverter.convert(recipe, randomResourceLocation());
CraftTweakerAPI.apply(new ActionAddRecipe(irecipe, UncraftingManager.recipes, "Added Shaped Recipe"));
}
示例10: addShapeless
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addShapeless(IItemStack output, IIngredient[] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action)
{
ShapelessRecipe recipe = new ShapelessRecipe(output, ingredients, function, action);
IRecipe irecipe = RecipeConverter.convert(recipe, randomResourceLocation());
CraftTweakerAPI.apply(new ActionAddRecipe(irecipe, UncraftingManager.recipes, "Added Shapeless Recipe"));
}
示例11: blockShaped
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void blockShaped(IItemStack output, IIngredient[][] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action)
{
ShapedRecipe recipe = new ShapedRecipe(output, ingredients, function, action, false);
IRecipe irecipe = RecipeConverter.convert(recipe, randomResourceLocation());
CraftTweakerAPI.apply(new ActionAddRecipe(irecipe, UncraftingManager.blockedRecipes, "Blocked Shaped Recipe"));
}
示例12: blockShapeless
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void blockShapeless(IItemStack output, IIngredient[] ingredients, @Optional IRecipeFunction function, @Optional IRecipeAction action)
{
ShapelessRecipe recipe = new ShapelessRecipe(output, ingredients, function, action);
IRecipe irecipe = RecipeConverter.convert(recipe, randomResourceLocation());
CraftTweakerAPI.apply(new ActionAddRecipe(irecipe, UncraftingManager.blockedRecipes, "Blocked Shapeless Recipe"));
}
示例13: addRecipe
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addRecipe(@Nullable IIngredient input, @Nullable IItemStack output, int time)
{
if (input == null || output == null)
{
Survivalist.logger.error("Required parameters missing for drying recipe.");
return;
}
Dryable.DryingRecipe recipe;
if (isOredict(input))
recipe = Dryable.registerRecipe(toOredictName(input), toStack(output), time);
else
recipe = Dryable.registerRecipe(toStack(input), toStack(output), time);
}
示例14: addRecipe
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addRecipe(IOreDictEntry input, IItemStack output) {
CraftTweaker.ADDITIONS.add(new Add(new HeatFrameCoolingRecipe(Helper.toPair(input), Helper.toStack(output))));
}
示例15: addRecipe
import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addRecipe(IIngredient[] input, double pressure, IItemStack[] output) {
CraftTweaker.ADDITIONS.add(new Add(new PressureChamberRecipe(Helper.toInput(input), (float)pressure, Helper.toStacks(output))));
}