1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-07-06 01:50:21 +02:00

MAJ mobs(redo) mod

Added switch to disable mobs in protected areas
This commit is contained in:
Ombridride
2014-12-15 00:17:29 +01:00
parent 2e3f86aaa2
commit 5163bf9551
7 changed files with 10 additions and 211 deletions

View File

@ -1,5 +1,7 @@
mobs = {}
mobs.mod = "redo"
mobs.protected = 0 -- Set to 1 if you do not wish mobs to spawn in protected areas (default: 0)
function mobs:register_mob(name, def)
minetest.register_entity(name, {
name = name,
@ -793,6 +795,11 @@ function mobs:register_spawn(name, nodes, max_light, min_light, chance, active_o
return
end
-- Check if protected area using bogus name so mobs will not spawn
if mobs.protected == 1 and minetest.is_protected(pos, "-") then
return
end
pos.y = pos.y+1
if not minetest.get_node_light(pos)