mirror of
https://github.com/Wyrrrd/bbr-fix.git
synced 2026-03-26 08:19:48 +01:00
dynamic recipe
This commit is contained in:
23
data-final-fixes.lua
Normal file
23
data-final-fixes.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
local base_recipe = {}
|
||||
-- grab rail recipe ingredients except stone
|
||||
for _,component in pairs(data.raw["recipe"]["rail"].ingredients) do
|
||||
cname = component[1] or component["name"]
|
||||
camount = component[2] or component["amount"]
|
||||
if cname ~= "stone" then
|
||||
table.insert(base_recipe,{cname,camount})
|
||||
end
|
||||
end
|
||||
|
||||
data.raw["recipe"]["bbr-rail-wood"].ingredients = table.deepcopy(base_recipe)
|
||||
data.raw["recipe"]["bbr-rail-iron"].ingredients = table.deepcopy(base_recipe)
|
||||
data.raw["recipe"]["bbr-rail-brick"].ingredients = table.deepcopy(base_recipe)
|
||||
|
||||
if settings.startup["bbr_fix_expensive"].value then
|
||||
table.insert(data.raw["recipe"]["bbr-rail-wood"].ingredients,{"wood",5})
|
||||
table.insert(data.raw["recipe"]["bbr-rail-iron"].ingredients,{"iron-plate",5})
|
||||
table.insert(data.raw["recipe"]["bbr-rail-brick"].ingredients,{"stone-brick",5})
|
||||
else
|
||||
table.insert(data.raw["recipe"]["bbr-rail-wood"].ingredients,{"wood",1})
|
||||
table.insert(data.raw["recipe"]["bbr-rail-iron"].ingredients,{"iron-plate",1})
|
||||
table.insert(data.raw["recipe"]["bbr-rail-brick"].ingredients,{"stone-brick",1})
|
||||
end
|
||||
Reference in New Issue
Block a user