1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 23:01:00 +02:00

changed water checks, jackolantern protection added

This commit is contained in:
TenPlus1
2019-05-08 19:30:20 +01:00
parent 4ad40a0ecb
commit 7c22eea12c
4 changed files with 15 additions and 3 deletions

View File

@ -52,7 +52,14 @@ minetest.register_abm({
end
-- check if there is water nearby and change soil accordingly
if minetest.find_node_near(pos, 3, {"group:water"}) then
-- if minetest.find_node_near(pos, 3, {"group:water"}) then
-- check if water is within 3 nodes horizontally and 2 below
if #minetest.find_nodes_in_area(
{x = pos.x + 3, y = pos.y + 2, z = pos.z + 3},
{x = pos.x - 3, y = pos.y , z = pos.z - 3},
{"group:water"}) > 0 then
if node.name == "farming:soil" then
minetest.set_node(pos, {name = "farming:soil_wet"})
end
@ -64,4 +71,4 @@ minetest.register_abm({
minetest.set_node(pos, {name = "default:dirt"})
end
end,
})
})