diff --git a/data-util.lua b/data-util.lua index d375cd2..27002ec 100644 --- a/data-util.lua +++ b/data-util.lua @@ -264,4 +264,14 @@ function multiply_recipe(recipe, multiple) end end +-- Remove an element of type t and name from data.raw +function util.remove_raw(t, name) + for i, elem in pairs(data.raw[t]) do + if elem.name == name then + data.raw[t][i] = nil + break + end + end +end + return util