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


Java IStackHelper类代码示例

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


IStackHelper类属于mezz.jei.api.recipe包,在下文中一共展示了IStackHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients)
{
    IStackHelper stackHelper = jeiHelpers.getStackHelper();
    ItemStack recipeOutput = recipe.getRecipeOutput();

    try
    {
        List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getIngredients());
        ingredients.setInputLists(ItemStack.class, inputs);
        ingredients.setOutput(ItemStack.class, recipeOutput);
    } catch (RuntimeException e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:cubex2,项目名称:customstuff4,代码行数:17,代码来源:ShapelessRecipeWrapper.java

示例2: getCookingRecipes

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Nonnull
public static List<StoveRecipe> getCookingRecipes(IJeiHelpers helpers)
{
    IStackHelper stackHelper = helpers.getStackHelper();
    StoveRecipes stoveRecipes = StoveRecipes.getInstance();
    Map<ItemStack, ItemStack> smeltingMap = stoveRecipes.getRECIPES();

    List<StoveRecipe> recipes = new ArrayList<>();

    for (Map.Entry<ItemStack, ItemStack> itemStackItemStackEntry : smeltingMap.entrySet()) {
        ItemStack input = itemStackItemStackEntry.getKey();
        ItemStack output = itemStackItemStackEntry.getValue();

        List<ItemStack> inputs = stackHelper.getSubtypes(input);
        StoveRecipe recipe = new StoveRecipe(inputs, output);
        recipes.add(recipe);
    }

    return recipes;
}
 
开发者ID:GamingsModding,项目名称:LittleThings-old,代码行数:21,代码来源:StoveRecipeMaker.java

示例3: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInputs());
	ingredients.setInputLists(ItemStack.class, inputs);
	
	List<List<FluidStack>> fluids = Lists.newArrayList();
	fluids.add(Lists.newArrayList(recipe.getFluidInput()));
	ingredients.setInputLists(FluidStack.class, fluids);

	ItemStack recipeOutput = recipe.getOutput();
	if (recipeOutput != null) {
		ingredients.setOutput(ItemStack.class, recipeOutput);
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:17,代码来源:InfuserRecipeCategory.java

示例4: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInputs());
	ingredients.setInputLists(ItemStack.class, inputs);

	List<ItemStack> outputStacks = Lists.newArrayList();
	if(ItemStackTools.isValid(recipe.getMainOutput())){
		outputStacks.add(recipe.getMainOutput());
	}
	if(ItemStackTools.isValid(recipe.getSecondaryOutput())){
		outputStacks.add(recipe.getSecondaryOutput());
	}
	ingredients.setOutputs(ItemStack.class, outputStacks);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:17,代码来源:GrinderRecipeCategory.java

示例5: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<Object> inputList = Lists.newArrayList();
	inputList.add(recipe.getMainInput());
	inputList.addAll(recipe.getInputs());
	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(inputList);
	ingredients.setInputLists(ItemStack.class, inputs);

	List<ItemStack> outputStacks = Lists.newArrayList();
	if(ItemStackTools.isValid(recipe.getOutput())){
		outputStacks.add(recipe.getOutput());
	}
	ingredients.setOutputs(ItemStack.class, outputStacks);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:17,代码来源:FusionRecipeCategory.java

示例6: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<Object> inputList = Lists.newArrayList();
	inputList.add(recipe.getInput());
	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(inputList);
	ingredients.setInputLists(ItemStack.class, inputs);

	List<List<FluidStack>> fluids = Lists.newArrayList();
	fluids.add(Lists.newArrayList(recipe.getFluidInput()));
	ingredients.setInputLists(FluidStack.class, fluids);
	
	List<ItemStack> outputStacks = Lists.newArrayList();
	if(ItemStackTools.isValid(recipe.getOutput())){
		outputStacks.add(recipe.getOutput());
	}
	ingredients.setOutputs(ItemStack.class, outputStacks);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:20,代码来源:CauldronRecipeCategory.java

示例7: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
    IStackHelper stackHelper = MoarSignsPlugin.jeiHelpers.getStackHelper();
    ArrayList<Object> inputs = new ArrayList<Object>();
    for (Object o : recipe.getInput()) {
        if (o instanceof MatchType || o instanceof MaterialInfo) {
            inputs.add(MoarSignsJeiRecipeHelper.getSigns(o));
        } else {
            inputs.add(o);
        }
    }
    ingredients.setInputLists(ItemStack.class, stackHelper.expandRecipeItemStackInputs(inputs));

    ItemStack recipeOutput = recipe.getRecipeOutput();
    if (recipeOutput != null) {
        ingredients.setOutput(ItemStack.class, recipeOutput);
    }
}
 
开发者ID:GoryMoon,项目名称:MoarSigns,代码行数:19,代码来源:MoarSignsRecipeWrapper.java

示例8: getTransmutatorRecipes

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Nonnull
public static List<TransmutationRecipe> getTransmutatorRecipes(IJeiHelpers helpers) {
	IStackHelper stackHelper = helpers.getStackHelper();
	TransmutatorRecipes transmutatorRecipes = TransmutatorRecipes.instance();
	Map<ItemStack, ItemStack> transmutationMap = getTransmutationMap(transmutatorRecipes);

	List<TransmutationRecipe> recipes = new ArrayList<>();

	for (Map.Entry<ItemStack, ItemStack> itemStackItemStackEntry : transmutationMap.entrySet()) {
		ItemStack input = itemStackItemStackEntry.getKey();
		ItemStack output = itemStackItemStackEntry.getValue();

		float experience = transmutatorRecipes.getExperience(output);

		List<ItemStack> inputs = stackHelper.getSubtypes(input);
		TransmutationRecipe recipe = new TransmutationRecipe(inputs, output, experience);
		if(isRecipeValid(recipe))
			recipes.add(recipe);
	}

	return recipes;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:23,代码来源:TransmutationRecipeMaker.java

示例9: getCrystallizerRecipes

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Nonnull
public static List<CrystallizationRecipe> getCrystallizerRecipes(IJeiHelpers helpers) {
	IStackHelper stackHelper = helpers.getStackHelper();
	CrystallizerRecipes crystallizerRecipes = CrystallizerRecipes.instance();
	Map<ItemStack, ItemStack[]> crystallizationMap = getCrystallizationMap(crystallizerRecipes);

	List<CrystallizationRecipe> recipes = new ArrayList<>();

	for (Map.Entry<ItemStack, ItemStack[]> itemStackItemStackEntry : crystallizationMap.entrySet()) {
		ItemStack input = itemStackItemStackEntry.getKey();
		ItemStack output = itemStackItemStackEntry.getValue()[0];
		ItemStack output2 = itemStackItemStackEntry.getValue()[1];

		float experience = crystallizerRecipes.getExperience(output);

		List<ItemStack> inputs = stackHelper.getSubtypes(input);
		CrystallizationRecipe recipe = new CrystallizationRecipe(inputs, output, output2, experience);
		if(isRecipeValid(recipe))
			recipes.add(recipe);
	}

	return recipes;
}
 
开发者ID:Shinoow,项目名称:AbyssalCraft,代码行数:24,代码来源:CrystallizationRecipeMaker.java

示例10: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInputs());
	ingredients.setInputLists(ItemStack.class, inputs);

	ItemStack recipeOutput = recipe.getOutput();
	if (recipeOutput != null) {
		ingredients.setOutput(ItemStack.class, recipeOutput);
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:13,代码来源:PressRecipeCategory.java

示例11: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInputs());
	ingredients.setInputLists(ItemStack.class, inputs);

	FluidStack recipeOutput = recipe.getOutput();
	if (recipeOutput != null) {
		ingredients.setOutput(FluidStack.class, recipeOutput);
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:13,代码来源:LiquidizerRecipeCategory.java

示例12: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();
	ItemStack recipeOutput = recipe.getRecipeOutput();

	try {
		List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(Arrays.asList(recipe.getInput()));
		ingredients.setInputLists(ItemStack.class, inputs);
		ingredients.setOutput(ItemStack.class, recipeOutput);
	} catch (RuntimeException e) {
		String info = ErrorUtil.getInfoFromBrokenCraftingRecipe(recipe, Arrays.asList(recipe.getInput()), recipeOutput);
		throw new BrokenCraftingRecipeException(info, e);
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:15,代码来源:ShapedOreCrystalRecipeWrapper.java

示例13: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();

	List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.recipeItems);
	ingredients.setInputLists(ItemStack.class, inputs);

	ItemStack recipeOutput = recipe.getRecipeOutput();
	if (recipeOutput != null) {
		ingredients.setOutput(ItemStack.class, recipeOutput);
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:13,代码来源:ShapelessCrystalRecipeWrapper.java

示例14: getRecipes

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Nonnull
public static List<CrusherRecipe> getRecipes(IJeiHelpers jeiHelpers) {
    IStackHelper stackHelper = jeiHelpers.getStackHelper();
    List<CrusherRecipe> recipes = new ArrayList<CrusherRecipe>();
    for (CrusherRegistryItem recipe : CrusherRegistry.getAllRecipes()) {
        recipes.add(new CrusherRecipe(
                stackHelper.getSubtypes(new ItemStack(recipe.getOre(), 1, recipe.getOreMeta())),
                recipe.createStack()
        ));
    }
    return recipes;
}
 
开发者ID:setycz,项目名称:AnotherDustsMod,代码行数:13,代码来源:CrusherRecipeMaker.java

示例15: getIngredients

import mezz.jei.api.recipe.IStackHelper; //导入依赖的package包/类
@Override
public void getIngredients(IIngredients ingredients) {
	IStackHelper stackHelper = jeiHelpers.getStackHelper();
	ItemStack recipeOutput = recipe.getRecipeOutput();

	try {
		List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInput());
		ingredients.setInputLists(ItemStack.class, inputs);
		ingredients.setOutput(ItemStack.class, recipeOutput);
	} catch (RuntimeException e) {
		String info = ErrorUtil.getInfoFromBrokenCraftingRecipe(recipe, recipe.getInput(), recipeOutput);
		throw new BrokenCraftingRecipeException(info, e);
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:15,代码来源:WrenchShapelessRecipeWrapper.java


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