use of gregtech.api.recipes.recipes.DummyRecipe in project GregTech by GregTechCE.
the class ModHandler method removeRecipes.
public static int removeRecipes(Predicate<IRecipe> predicate) {
int recipesRemoved = 0;
IForgeRegistry<IRecipe> registry = ForgeRegistries.RECIPES;
List<IRecipe> toRemove = new ArrayList<>();
for (IRecipe recipe : registry) {
if (predicate.test(recipe)) {
toRemove.add(recipe);
recipesRemoved++;
}
}
toRemove.forEach(recipe -> registry.register(new DummyRecipe().setRegistryName(recipe.getRegistryName())));
return recipesRemoved;
}
use of gregtech.api.recipes.recipes.DummyRecipe in project GregTech by GregTechCEu.
the class ModHandler method removeRecipes.
public static int removeRecipes(Predicate<IRecipe> predicate) {
int recipesRemoved = 0;
IForgeRegistry<IRecipe> registry = ForgeRegistries.RECIPES;
List<IRecipe> toRemove = new ArrayList<>();
for (IRecipe recipe : registry) {
if (predicate.test(recipe)) {
toRemove.add(recipe);
recipesRemoved++;
}
}
toRemove.forEach(recipe -> registry.register(new DummyRecipe().setRegistryName(recipe.getRegistryName())));
return recipesRemoved;
}
Aggregations