From 64ec1fd03d77d95b0f37a3bb91cedf3d898042cc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 25 May 2017 02:15:24 +0200 Subject: [PATCH] Update monster spawner docs --- mods/ENTITIES/mcl_monster_spawner/README.md | 9 +++++++++ mods/ENTITIES/mcl_monster_spawner/init.lua | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_monster_spawner/README.md b/mods/ENTITIES/mcl_monster_spawner/README.md index 9712900528..311b664e7a 100644 --- a/mods/ENTITIES/mcl_monster_spawner/README.md +++ b/mods/ENTITIES/mcl_monster_spawner/README.md @@ -4,5 +4,14 @@ Monsters will appear around the monster spawner in semi-regular intervals. This mod is originally based on the mob spawner from Mobs Redo by TenPlus1 but has been modified quite a lot to fit the needs of MineClone 2. +Players can get a monster spawner by `giveme` and is initially empty after +placing. + +## Programmer notes +To set the mob spawned by a monster spawner, first place the monster spawner +(e.g. with `minetest.set_node`), then use the function +`mcl_monster_spawner.setup_spawner` to set its attributes. See the comment +in `init.lua` for more info. + ## License (code and texture) MIT License diff --git a/mods/ENTITIES/mcl_monster_spawner/init.lua b/mods/ENTITIES/mcl_monster_spawner/init.lua index 07e671ff41..c31f89f660 100644 --- a/mods/ENTITIES/mcl_monster_spawner/init.lua +++ b/mods/ENTITIES/mcl_monster_spawner/init.lua @@ -50,7 +50,7 @@ All the following arguments are optional! * YOffset: Y offset to spawn mobs; 0 to disable (default: 0) ]] -function mobs.setup_spawner(pos, Mob, MinLight, MaxLight, MaxMobsInArea, PlayerDistance, YOffset) +function mcl_monster_spawner.setup_spawner(pos, Mob, MinLight, MaxLight, MaxMobsInArea, PlayerDistance, YOffset) -- Activate monster spawner and disable editing functionality if MinLight == nil then MinLight = 0 end if MaxLight == nil then MinLight = 15 end @@ -144,7 +144,7 @@ minetest.register_node("mcl_monster_spawner:spawner", { and pla and pla >=0 and pla <= 20 and yof and yof > -10 and yof < 10 then - mobs.setup_spawner(pos, mob, mlig, xlig, num, pla, yof) + mcl_monster_spawner.setup_spawner(pos, mob, mlig, xlig, num, pla, yof) else minetest.chat_send_player(name, S("Mob Spawner settings failed!")) minetest.chat_send_player(name,