Search in sources :

Example 1 with IJeiRuntime

use of mezz.jei.api.runtime.IJeiRuntime in project minecolonies by Minecolonies.

the class JEIPlugin method onCustomRecipesReloaded.

private void onCustomRecipesReloaded(@NotNull final CustomRecipesReloadedEvent event) {
    // the usual place once we know that happened).
    if (weakRuntime != null && !recipesLoaded && !categories.isEmpty()) {
        final IJeiRuntime runtime = weakRuntime.get();
        if (runtime != null) {
            final IRecipeManager jeiManager = runtime.getRecipeManager();
            populateRecipes(buildVanillaRecipesMap(), (list, uid) -> {
                for (final Object recipe : list) {
                    // noinspection deprecation
                    jeiManager.addRecipe(recipe, uid);
                }
            });
        }
    }
    recipesLoaded = true;
}
Also used : IRecipeManager(mezz.jei.api.recipe.IRecipeManager) IJeiRuntime(mezz.jei.api.runtime.IJeiRuntime)

Example 2 with IJeiRuntime

use of mezz.jei.api.runtime.IJeiRuntime in project minecolonies by ldtteam.

the class JEIPlugin method onCustomRecipesReloaded.

private void onCustomRecipesReloaded(@NotNull final CustomRecipesReloadedEvent event) {
    // the usual place once we know that happened).
    if (weakRuntime != null && !recipesLoaded && !categories.isEmpty()) {
        final IJeiRuntime runtime = weakRuntime.get();
        if (runtime != null) {
            final IRecipeManager jeiManager = runtime.getRecipeManager();
            populateRecipes(buildVanillaRecipesMap(), (list, uid) -> {
                for (final Object recipe : list) {
                    // noinspection deprecation
                    jeiManager.addRecipe(recipe, uid);
                }
            });
        }
    }
    recipesLoaded = true;
}
Also used : IRecipeManager(mezz.jei.api.recipe.IRecipeManager) IJeiRuntime(mezz.jei.api.runtime.IJeiRuntime)

Aggregations

IRecipeManager (mezz.jei.api.recipe.IRecipeManager)2 IJeiRuntime (mezz.jei.api.runtime.IJeiRuntime)2