Search in sources :

Example 1 with IRecipeBuilderCopyStrategyInternal

use of com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.IRecipeBuilderCopyStrategyInternal in project artisan-worktables by codetaylor.

the class RecipeAdditionQueue method onRegisterRecipesEvent.

@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRegisterRecipesEvent(RegistryEvent.Register<IRecipe> event) {
    for (RecipeBuilderInternal builder : this.recipeBuilderWithCopyList) {
        IRecipeBuilderCopyStrategyInternal recipeCopyStrategy = builder.getRecipeCopyStrategy();
        if (recipeCopyStrategy != null) {
            try {
                recipeCopyStrategy.apply(builder, this.recipeBuilderList);
            } catch (Exception e) {
                ModuleWorktables.LOG.error("", e);
            }
        }
    }
    for (RecipeBuilderInternal builder : this.recipeBuilderList) {
        try {
            builder.apply(LOGGER);
        } catch (RecipeBuilderException e) {
            ModuleWorktables.LOG.error("", e);
        }
    }
    this.recipeBuilderList.clear();
    this.recipeBuilderWithCopyList.clear();
}
Also used : IRecipeBuilderCopyStrategyInternal(com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.IRecipeBuilderCopyStrategyInternal) RecipeBuilderException(com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeBuilderException) RecipeBuilderException(com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeBuilderException) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

RecipeBuilderException (com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeBuilderException)1 IRecipeBuilderCopyStrategyInternal (com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.IRecipeBuilderCopyStrategyInternal)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1