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:
36
soil.lua
36
soil.lua
@ -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
|
||||
})
|
||||
|
Reference in New Issue
Block a user