forked from mtcontrib/farming
tweak soil dry abm
This commit is contained in:
parent
ad9b0dc255
commit
31c7b589c1
23
soil.lua
23
soil.lua
@ -173,11 +173,6 @@ minetest.register_abm({
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- if map around soil not loaded then skip until loaded
|
|
||||||
if minetest.find_node_near(pos, 3, {"ignore"}) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- check if water is within 3 nodes
|
-- check if water is within 3 nodes
|
||||||
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||||
|
|
||||||
@ -186,14 +181,18 @@ minetest.register_abm({
|
|||||||
minetest.set_node(pos, {name = ndef.soil.wet})
|
minetest.set_node(pos, {name = ndef.soil.wet})
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif node.name == ndef.soil.wet then
|
-- only dry out soil if no unloaded blocks nearby, just incase
|
||||||
minetest.set_node(pos, {name = ndef.soil.dry})
|
elseif not minetest.find_node_near(pos, 3, {"ignore"}) then
|
||||||
|
|
||||||
-- if crop or seed found don't turn to dry soil
|
if node.name == ndef.soil.wet then
|
||||||
elseif node.name == ndef.soil.dry
|
minetest.set_node(pos, {name = ndef.soil.dry})
|
||||||
and minetest.get_item_group(nn, "plant") == 0
|
|
||||||
and minetest.get_item_group(nn, "growing") == 0 then
|
-- if crop or seed found don't turn to dry soil
|
||||||
minetest.set_node(pos, {name = ndef.soil.base})
|
elseif node.name == ndef.soil.dry
|
||||||
|
and minetest.get_item_group(nn, "plant") == 0
|
||||||
|
and minetest.get_item_group(nn, "growing") == 0 then
|
||||||
|
minetest.set_node(pos, {name = ndef.soil.base})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user