Make soil destroy crops when dried out
This commit is contained in:
parent
70157c5c71
commit
4a910e295f
@ -109,6 +109,7 @@
|
||||
tiles = def.tiles
|
||||
end
|
||||
|
||||
def.groups.plants = 1
|
||||
|
||||
minetest.register_node(nodename, {
|
||||
description = def.description,
|
||||
|
@ -29,6 +29,9 @@ for level,dryness in pairs(farmland) do
|
||||
minetest.set_node(pos,{name="farming:farmland_wet"})
|
||||
else
|
||||
minetest.set_node(pos,{name="main:dirt"})
|
||||
if minetest.get_node_group(minetest.get_node(vector.new(pos.x,pos.y+1,pos.z)).name, "plant") > 0 then
|
||||
minetest.dig_node(vector.new(pos.x,pos.y+1,pos.z))
|
||||
end
|
||||
end
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(1)
|
||||
@ -42,6 +45,9 @@ for level,dryness in pairs(farmland) do
|
||||
timer:start(1)
|
||||
else
|
||||
minetest.set_node(pos,{name="main:dirt"})
|
||||
if minetest.get_node_group(minetest.get_node(vector.new(pos.x,pos.y+1,pos.z)).name, "plant") > 0 then
|
||||
minetest.dig_node(vector.new(pos.x,pos.y+1,pos.z))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user