From 1dc5b92314f8c212523de546ce5f2bbf828b9762 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 344ef3f..d49f45c 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 })