From 843009965f98f6aa51de417156651f67587dbb23 Mon Sep 17 00:00:00 2001 From: PilzAdam Date: Sat, 13 Oct 2012 18:44:59 +0200 Subject: [PATCH] Add a table with booleans for each spawing mob that sets whether the mob spawns --- api.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api.lua b/api.lua index 1550028..f4b1fcd 100644 --- a/api.lua +++ b/api.lua @@ -333,13 +333,18 @@ function mobs:register_mob(name, def) }) end +mobs.spawning_mobs = {} function mobs:register_spawn(name, nodes, max_light, min_light, chance, mobs_per_30_block_radius, max_height) + mobs.spawning_mobs[name] = true minetest.register_abm({ nodenames = nodes, neighbors = nodes, interval = 30, chance = chance, action = function(pos, node) + if not mobs.spawning_mobs[name] then + return + end pos.y = pos.y+1 if not minetest.env:get_node_light(pos) then return