当前位置: 首页>>代码示例>>Java>>正文


Java IItemStack类代码示例

本文整理汇总了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));
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:9,代码来源:Assembly.java

示例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()]);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:16,代码来源:Helper.java

示例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;
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:13,代码来源:Helper.java

示例4: toIItemStack

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static IItemStack toIItemStack(ItemStack stack) {
    if(stack.isEmpty()) {
        return null;
    }
    
    return new MCItemStack(stack);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:Helper.java

示例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);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:8,代码来源:Helper.java

示例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));
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:8,代码来源:Stamper.java

示例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));
}
 
开发者ID:DaedalusGame,项目名称:Soot,代码行数:12,代码来源:Alchemy.java

示例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);
}
 
开发者ID:HellFirePvP,项目名称:ModularMachinery,代码行数:14,代码来源:RecipePrimer.java

示例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"));
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:8,代码来源:CraftTweakerIntegration.java

示例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"));
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:9,代码来源:CraftTweakerIntegration.java

示例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"));
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:9,代码来源:CraftTweakerIntegration.java

示例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"));
}
 
开发者ID:crazysnailboy,项目名称:UncraftingTable,代码行数:9,代码来源:CraftTweakerIntegration.java

示例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);
}
 
开发者ID:gigaherz,项目名称:Survivalist,代码行数:16,代码来源:CraftTweakerPlugin.java

示例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))));

}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:6,代码来源:HeatFrameCooling.java

示例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))));
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:PressureChamber.java


注:本文中的crafttweaker.api.item.IItemStack类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。