1
0
Fork 0

Update monster spawner docs

objects
Wuzzy 2017-05-25 02:15:24 +02:00
parent 097de371b6
commit 64ec1fd03d
2 changed files with 11 additions and 2 deletions

View File

@ -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 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. 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) ## License (code and texture)
MIT License MIT License

View File

@ -50,7 +50,7 @@ All the following arguments are optional!
* YOffset: Y offset to spawn mobs; 0 to disable (default: 0) * 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 -- Activate monster spawner and disable editing functionality
if MinLight == nil then MinLight = 0 end if MinLight == nil then MinLight = 0 end
if MaxLight == nil then MinLight = 15 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 pla and pla >=0 and pla <= 20
and yof and yof > -10 and yof < 10 then 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 else
minetest.chat_send_player(name, S("Mob Spawner settings failed!")) minetest.chat_send_player(name, S("Mob Spawner settings failed!"))
minetest.chat_send_player(name, minetest.chat_send_player(name,