• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IItemStack类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中crafttweaker.api.item.IItemStack的典型用法代码示例。如果您正苦于以下问题:Java IItemStack类的具体用法?Java IItemStack怎么用?Java IItemStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IItemStack类属于crafttweaker.api.item包,在下文中一共展示了IItemStack类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: addRecipe

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addRecipe(ILiquidStack liquidInput, IItemStack itemInput, double pressure, double temperature, ILiquidStack output) {
	CraftTweaker.ADDITIONS.add(new Add(new BasicThermopneumaticProcessingPlantRecipe(Helper.toFluid(liquidInput), Helper.toStack(itemInput), Helper.toFluid(output), temperature, (float) pressure)));
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:ThermopneumaticProcessingPlant.java


示例17: addDrillRecipe

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addDrillRecipe(IItemStack input, IItemStack output) {
    addRecipe(nameDrill, input, output, AssemblyRecipe.drillRecipes);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:Assembly.java


示例18: addLaserRecipe

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addLaserRecipe(IItemStack input, IItemStack output) {
    addRecipe(nameLaser, input, output, AssemblyRecipe.laserRecipes);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:Assembly.java


示例19: addDrillLaserRecipe

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
@ZenMethod
public static void addDrillLaserRecipe(IItemStack input, IItemStack output) {
    addRecipe(nameDrillLaser, input, output, AssemblyRecipe.drillLaserRecipes);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:5,代码来源:Assembly.java


示例20: toStacks

import crafttweaker.api.item.IItemStack; //导入依赖的package包/类
public static IItemStack[] toStacks(IIngredient[] iIngredient) {
	return Stream.of(iIngredient).map(i -> i.getItems()).flatMap(List::stream).toArray(IItemStack[]::new);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:4,代码来源:Helper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JenkinsHttpClient类代码示例发布时间:2022-05-22
下一篇:
Java Serializer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap