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

add setting to disable weeds

This commit is contained in:
tenplus1
2025-02-17 08:09:55 +00:00
parent ba4026c406
commit 1416f6e615
3 changed files with 23 additions and 17 deletions

View File

@ -197,23 +197,27 @@ minetest.register_abm({
-- those darn weeds
minetest.register_abm({
nodenames = {"group:field"},
neighbors = {"air"},
interval = 50,
chance = 35,
catch_up = false,
if minetest.settings:get_bool("farming_disable_weeds") ~= true then
action = function(pos, node)
minetest.register_abm({
nodenames = {"group:field"},
neighbors = {"air"},
interval = 50,
chance = 35,
catch_up = false,
if minetest.find_node_near(pos, 4, {"farming:scarecrow_bottom"}) then
return
action = function(pos, node)
if minetest.find_node_near(pos, 4, {"farming:scarecrow_bottom"}) then
return
end
pos.y = pos.y + 1
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "farming:weed", param2 = 2})
end
end
})
end
pos.y = pos.y + 1
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name = "farming:weed", param2 = 2})
end
end
})