Add Salt.lua

Add new reactor recipes for salt and adds salt to powdered group.
This commit is contained in:
Eternal-Study 2024-06-29 20:31:37 -04:00 committed by GitHub
parent 46cd8b111d
commit a3d77f5ff1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

44
items/salt.lua Normal file
View File

@ -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)