mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 02:00:21 +01:00
dont spawn mobs if world anchor found nearby
This commit is contained in:
parent
1a85cf7e2c
commit
26cc611ad4
11
api.lua
11
api.lua
@ -3404,6 +3404,8 @@ function mobs:spawn_abm_check(pos, node, name)
|
|||||||
-- return true to stop spawning mob
|
-- return true to stop spawning mob
|
||||||
end
|
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,
|
function mobs:spawn_specific(name, nodes, neighbors, min_light, max_light,
|
||||||
interval, chance, aoc, min_height, max_height, day_toggle, on_spawn)
|
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
|
return
|
||||||
end
|
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
|
-- only spawn away from player
|
||||||
local objs = minetest.get_objects_inside_radius(pos, 8)
|
local objs = minetest.get_objects_inside_radius(pos, 8)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ Lucky Blocks: 9
|
|||||||
|
|
||||||
|
|
||||||
Changelog:
|
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.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.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
|
- 1.47- Mob damage changes, min and max light level for damage added, ignition sources checked for lava damage
|
||||||
|
Loading…
Reference in New Issue
Block a user