1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-07-20 05:50:23 +02:00

Add farming mod

This commit is contained in:
PilzAdam
2012-09-03 15:26:49 +02:00
parent 4efba586ad
commit faa676fd0c
97 changed files with 1839 additions and 0 deletions

22
mods/farming/cactus.lua Normal file
View File

@ -0,0 +1,22 @@
minetest.register_abm({
nodenames = {"default:cactus"},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.env:get_node(pos).name
if name == "default:desert_sand" or name == "default:sand" then
pos.y = pos.y+1
local height = 0
while minetest.env:get_node(pos).name == "default:cactus" do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.env:get_node(pos).name == "air" then
minetest.env:set_node(pos, node)
end
end
end
end
})