Skip to content

Commit

Permalink
Create util method to mass remove recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
juraj-hrivnak committed Aug 27, 2024
1 parent a666741 commit e6bdaa3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion groovy/classes/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.jetbrains.annotations.Nullable
class Utils {

/**
* Remove and hide items
* Remove recipes from items & hide items
*/
static void purge(IIngredient... inputs) {
inputs.each { input ->
Expand All @@ -41,6 +41,18 @@ class Utils {
}
}

/**
* Remove recipes from items
*/
static void removeRecipe(IIngredient... inputs) {
inputs.each { input ->
input.matchingStacks.each { itemStack ->
// Remove recipe
itemStack.removeRecipe()
}
}
}

/** Localize translation key */
@SideOnly(Side.CLIENT)
static String localize(String key) {
Expand Down

0 comments on commit e6bdaa3

Please sign in to comment.