1
0
mirror of https://github.com/Wyrrrd/bbr-fix.git synced 2026-03-25 15:59:49 +01:00
Files
bbr-fix/data-final-fixes.lua
2021-09-06 23:28:10 +02:00

25 lines
1.1 KiB
Lua

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)
multiplier = settings.startup["bbr-fix-cost"].value
if multiplier>0 then
table.insert(data.raw["recipe"]["bbr-rail-wood"].ingredients,{"wood",multiplier})
table.insert(data.raw["recipe"]["bbr-rail-iron"].ingredients,{"iron-plate",multiplier})
table.insert(data.raw["recipe"]["bbr-rail-brick"].ingredients,{"stone-brick",multiplier})
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