Search in sources :

Example 1 with IManaInfusionRecipe

use of vazkii.botania.api.recipe.IManaInfusionRecipe in project Botania by VazkiiMods.

the class ManaInfusionProcessor method setup.

@Override
public void setup(IVariableProvider variables) {
    if (variables.has("recipes") && variables.has("group")) {
        BotaniaAPI.LOGGER.warn("Mana infusion template has both 'recipes' and 'group', ignoring 'recipes'");
    }
    ImmutableList.Builder<IManaInfusionRecipe> builder = ImmutableList.builder();
    if (variables.has("group")) {
        String group = variables.get("group").asString();
        builder.addAll(PatchouliUtils.getRecipeGroup(ModRecipeTypes.MANA_INFUSION_TYPE, group));
    } else {
        for (IVariable s : variables.get("recipes").asListOrSingleton()) {
            IManaInfusionRecipe recipe = PatchouliUtils.getRecipe(ModRecipeTypes.MANA_INFUSION_TYPE, new ResourceLocation(s.asString()));
            if (recipe != null) {
                builder.add(recipe);
            }
        }
    }
    this.recipes = builder.build();
    this.hasCustomHeading = variables.has("heading");
}
Also used : IManaInfusionRecipe(vazkii.botania.api.recipe.IManaInfusionRecipe) ImmutableList(com.google.common.collect.ImmutableList) IVariable(vazkii.patchouli.api.IVariable) ResourceLocation(net.minecraft.resources.ResourceLocation)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 IManaInfusionRecipe (vazkii.botania.api.recipe.IManaInfusionRecipe)1 IVariable (vazkii.patchouli.api.IVariable)1