diff options
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -1,5 +1,5 @@ --- Mobs Api (21st July 2016) +-- Mobs Api (3rd August 2016) mobs = {} mobs.mod = "redo" @@ -2400,7 +2400,7 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, chance = chance, catch_up = true, - action = function(pos, node, aoc, active_object_count_wider) + action = function(pos, node, active_object_count, active_object_count_wider) -- do not spawn if too many active entities in area if active_object_count_wider > active_object_count @@ -2491,6 +2491,25 @@ function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_o chance, active_object_count, -31000, max_height, day_toggle) end +-- MarkBu's spawn function +function mobs:spawn(def) + + local name = def.name + local nodes = def.nodes or {"group:soil", "group:stone"} + local neighbors = def.neighbors or {"air"} + local min_light = def.min_light or 0 + local max_light = def.max_light or 15 + local interval = def.interval or 30 + local chance = def.chance or 5000 + local active_object_count = def.active_object_count or 1 + local min_height = def.min_height or -31000 + local max_height = def.max_height or 31000 + local day_toggle = def.day_toggle or nil + + mobs:spawn_specific(name, nodes, neighbors, min_light, max_light, interval, + chance, active_object_count, min_height, max_height, day_toggle) +end + -- set content id's local c_air = minetest.get_content_id("air") local c_ignore = minetest.get_content_id("ignore") |