From e99b28d2787d85a2bd38e15090bc56bff9aa4cbb Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 15 Jun 2021 02:21:34 -0700 Subject: [PATCH] remove raw fn --- util.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util.lua b/util.lua index 5548b08..83f995c 100644 --- a/util.lua +++ b/util.lua @@ -265,4 +265,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