use of mezz.jei.api.recipe.IRecipeManager 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;
}
use of mezz.jei.api.recipe.IRecipeManager in project Botania by VazkiiMods.
the class JEIBotaniaPlugin method onRuntimeAvailable.
@Override
public void onRuntimeAvailable(IJeiRuntime jeiRuntime) {
IRecipeManager recipeRegistry = jeiRuntime.getRecipeManager();
// Hide the return recipes (iron ingot/diamond/ender pearl returns, not lexicon)
for (IElvenTradeRecipe recipe : TileAlfPortal.elvenTradeRecipes(Minecraft.getInstance().level)) {
if (recipe instanceof LexiconElvenTradeRecipe) {
continue;
}
List<Ingredient> inputs = recipe.getIngredients();
List<ItemStack> outputs = recipe.getOutputs();
if (inputs.size() == 1 && outputs.size() == 1 && recipe.containsItem(outputs.get(0))) {
recipeRegistry.hideRecipe(recipe, ElvenTradeRecipeCategory.UID);
}
}
RecipeManager recipeManager = Minecraft.getInstance().level.getRecipeManager();
recipeManager.byKey(prefix("petal_apothecary/daybloom_motif")).ifPresent(r -> recipeRegistry.hideRecipe(r, PetalApothecaryRecipeCategory.UID));
recipeManager.byKey(prefix("petal_apothecary/nightshade_motif")).ifPresent(r -> recipeRegistry.hideRecipe(r, PetalApothecaryRecipeCategory.UID));
CorporeaInputHandler.jeiPanelSupplier = () -> {
ItemStack stack = jeiRuntime.getIngredientListOverlay().getIngredientUnderMouse(VanillaTypes.ITEM);
if (stack == null && Minecraft.getInstance().screen == jeiRuntime.getRecipesGui()) {
stack = jeiRuntime.getRecipesGui().getIngredientUnderMouse(VanillaTypes.ITEM);
}
if (stack == null) {
stack = jeiRuntime.getBookmarkOverlay().getIngredientUnderMouse(VanillaTypes.ITEM);
}
if (stack != null) {
return stack;
}
return ItemStack.EMPTY;
};
CorporeaInputHandler.supportedGuiFilter = gui -> gui instanceof AbstractContainerScreen<?> || gui instanceof IRecipesGui;
}
use of mezz.jei.api.recipe.IRecipeManager 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;
}
Aggregations