From 1eeb7ff1011a274691992205a6e7a8d3396a5663 Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 15 Jun 2021 02:21:06 -0700 Subject: [PATCH] remove raw fn --- data-util.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data-util.lua b/data-util.lua index 385f5d0..e105fed 100644 --- a/data-util.lua +++ b/data-util.lua @@ -268,4 +268,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