mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-16 07:20:31 +01:00
Fixed the Soil abm.
This commit is contained in:
parent
283530ad6f
commit
9e03189586
|
@ -45,15 +45,19 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check if there is water nearby and change soil accordingly
|
-- check if there is water nearby and change soil accordingly
|
||||||
if minetest.find_node_near(pos, 3, {"group:water"}) and
|
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||||
minetest.find_node_near(pos, 3, {"ignore"}) then
|
|
||||||
if node.name == "farming:soil" then
|
if node.name == "farming:soil" then
|
||||||
minetest.set_node(pos, {name="farming:soil_wet"})
|
minetest.set_node(pos, {name="farming:soil_wet"})
|
||||||
end
|
end
|
||||||
elseif node.name == "farming:soil_wet" then
|
else
|
||||||
minetest.set_node(pos, {name="farming:soil"})
|
-- Don't turn wet soil into dry soil or dry soil into dirt
|
||||||
elseif node.name == "farming:soil" then
|
-- if there are unloaded blocks nearby because they could be water.
|
||||||
minetest.set_node(pos, {name="default:dirt"})
|
if minetest.find_node_near(pos, 3, {"ignore"}) then return end
|
||||||
|
if node.name == "farming:soil_wet" then
|
||||||
|
minetest.set_node(pos, {name="farming:soil"})
|
||||||
|
else -- [obviously] node.name == "farming:soil"
|
||||||
|
minetest.set_node(pos, {name="default:dirt"})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user