diff --git a/init.lua b/init.lua index f359717..1dfd234 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ TechAge ======= - Copyright (C) 2019-2023 Joachim Stolberg + Copyright (C) 2019-2024 Joachim Stolberg AGPL v3 See LICENSE.txt for more information @@ -394,6 +394,7 @@ dofile(MP.."/items/cracking.lua") dofile(MP.."/items/ceramic.lua") dofile(MP.."/items/basalt.lua") dofile(MP.."/items/moreblocks.lua") +dofile(MP.."/items/salt.lua") -- Carts dofile(MP.."/carts/tank_cart.lua") diff --git a/items/salt.lua b/items/salt.lua new file mode 100644 index 0000000..dd59a02 --- /dev/null +++ b/items/salt.lua @@ -0,0 +1,44 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2024 Joachim Stolberg + + AGPL v3 + See LICENSE.txt for more information + + Salt + +]]-- + +local S = techage.S + + +--Detects if the salt node is registered. +minetest.register_on_mods_loaded(function() + if minetest.registered_nodes["farming:salt"] then + --Adds salt to powder group to ensure reactor and silo will accept it + local def = minetest.registered_nodes["farming:salt"] + local groups = table.copy(def.groups) + groups.powder = 1 + minetest.override_item("farming:salt", { groups=groups }) + + --Add the water -> salt & river water recipe. + techage.recipes.add("ta4_doser", { + output = "farming:salt 1", + waste = "techage:river_water 1", + input = { + "techage:water 1", + } + }) + else + -- Creates a water -> River Water recipe in absense of the farming:salt node. + techage.recipes.add("ta4_doser", { + output = "techage:river_water 1", + input = { + "techage:water 1", + } + }) + end +end)