clams spawn less naturally and grow instead

This commit is contained in:
kaadmy 2015-10-07 13:56:45 -07:00
parent 625cb7fefc
commit e6112839b1
2 changed files with 22 additions and 2 deletions

View File

@ -222,6 +222,26 @@ minetest.register_abm( -- grass expands
end
})
minetest.register_abm( -- clams grow
{
nodenames = {"default:clam"},
interval = 20,
chance = 160,
action = function(pos, node)
local rx = math.random(0, 2) - 1
local rz = math.random(0, 2) - 1
local edgepos = {x = pos.x+rx, y = pos.y, z = pos.z+rz}
local downpos = {x = pos.x+rx, y = pos.y-1, z = pos.z+rz}
local edgenode = minetest.get_node(edgepos)
local downnode = minetest.get_node(downpos)
if edgenode.name == "air" and downnode.name ~= "air" and downnode.buildable_to == false and walkable == true then
minetest.set_node(edgepos, {name = "default:clam"})
end
end
})
minetest.register_abm( -- cactus grows
{
nodenames = {"default:cactus"},

View File

@ -517,10 +517,10 @@ minetest.register_decoration(
deco_type = "simple",
place_on = {"default:sand", "default:gravel"},
sidelen = 16,
fill_ratio = 0.04,
fill_ratio = 0.02,
biomes = {"Grassland Ocean", "Gravel Beach"},
decoration = {"default:clam"},
y_min = -32000,
y_min = 0,
y_max = 1,
})