本文整理汇总了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();
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}