dont spawn mobs if world anchor found nearby

This commit is contained in:
TenPlus1 2019-06-30 12:47:28 +01:00
parent 1a85cf7e2c
commit 26cc611ad4
2 changed files with 12 additions and 1 deletions

11
api.lua
View File

@ -3404,6 +3404,8 @@ function mobs:spawn_abm_check(pos, node, name)
-- return true to stop spawning mob
end
local mod_technic = minetest.get_modpath("technic") or
minetest.get_modpath("simple_anchor")
function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
@ -3508,6 +3510,15 @@ function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
return
end
-- do not spawn if world anchor block is nearby
if mod_technic
and #minetest.find_nodes_in_area(
{x = pos.x - 32, y = pos.y - 32, z = pos.z - 32},
{x = pos.x + 32, y = pos.y + 32, z = pos.z + 32},
{"technic:admin_anchor", "simple_anchor:loader_block"}) > 0 then
return
end
-- only spawn away from player
local objs = minetest.get_objects_inside_radius(pos, 8)

View File

@ -23,7 +23,7 @@ Lucky Blocks: 9
Changelog:
- 1.50 - Added new line_of_sight function that uses raycasting if mt5.0 is found (thanks Astrobe)
- 1.50 - Added new line_of_sight function that uses raycasting if mt5.0 is found (thanks Astrobe), dont spawn mobs if world anchor nearby (technic or simple_anchor mods)
- 1.49- Added mobs:force_capture(self, player) function, api functions now use metatables thanks to bell07
- 1.48- Add mobs:set_velocity(self, velocity) global function
- 1.47- Mob damage changes, min and max light level for damage added, ignition sources checked for lava damage