From 46cd8b111dcc800364ea2b3bf3a51460bcc86f0e Mon Sep 17 00:00:00 2001 From: Eternal-Study <165338259+Eternal-Study@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:28:22 -0400 Subject: [PATCH 1/2] Water to Salt + River Water Recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pull requests adds a Water to River Water reactor recipe. If it detects a farming:salt node (as found in the Farming Redo mod) then it adds salt to the powder group, allowing it to be stored in silos, and changes the recipe to Water → Salt with River Water as a waste product. It should be noted that issue [insert issue number here] must be resolved to implement this pull request, as otherwise nodes cannot be loaded into the silo, even if they are in the powder group. This pull request was tested with pull request [insert pull request number] implemented. Using another solution to issue [insert issue number here] may require updates to the pull request. I release this code under the terms of AGPL v3, and transfer copyright to Joachim Stolberg. --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") From a3d77f5ff1ae87830f2641bd6ae6b4c955cb3f80 Mon Sep 17 00:00:00 2001 From: Eternal-Study <165338259+Eternal-Study@users.noreply.github.com> Date: Sat, 29 Jun 2024 20:31:37 -0400 Subject: [PATCH 2/2] Add Salt.lua Add new reactor recipes for salt and adds salt to powdered group. --- items/salt.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 items/salt.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)