From 439646417a0f1443c1b959664a89576be3d74a4e Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Mon, 29 May 2017 00:58:55 -0700 Subject: [PATCH] Add method 'sneaker.spawn' to spawn entity --- functions.lua | 6 ++++++ spawn.lua | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.lua b/functions.lua index a263c41..f8437fe 100644 --- a/functions.lua +++ b/functions.lua @@ -12,3 +12,9 @@ function sneeker.log_debug(message) sneeker.log('[DEBUG] ' .. message) end end + +-- Spawns a sneaker entity +function sneeker.spawn(pos) + minetest.add_entity(pos, sneeker.mob_name) + sneeker.log_debug('Spawned entity "' .. sneeker.mob_name .. '" at ' .. tostring(pos.x) .. ',' .. tostring(pos.y)) +end diff --git a/spawn.lua b/spawn.lua index 49bc29e..090e419 100644 --- a/spawn.lua +++ b/spawn.lua @@ -52,6 +52,6 @@ minetest.register_abm({ end if count >= sneeker.spawn_cap then return end -- Max sneekers already exist - minetest.add_entity(pos, sneeker.mob_name) + sneeker.spawn(pos) end })