diff --git a/api.lua b/api.lua index 449a925..c2344bc 100644 --- a/api.lua +++ b/api.lua @@ -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) diff --git a/readme.MD b/readme.MD index 3d5ff04..27d552f 100644 --- a/readme.MD +++ b/readme.MD @@ -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