1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2025-04-19 03:50:24 +02:00

use tnt or mcl_explosions for mobs:boom

This commit is contained in:
tenplus1 2025-04-11 10:12:30 +01:00
parent 24adcae920
commit 68b25c9d08

12
api.lua
View File

@ -3934,14 +3934,19 @@ function mobs:safe_boom(self, pos, radius, texture)
effect(pos, 32, texture, radius * 3, radius * 5, radius, 1, 0) effect(pos, 32, texture, radius * 3, radius * 5, radius, 1, 0)
end end
-- explosion with protection and tnt mod check -- explosion with tnt mod checks
function mobs:boom(self, pos, node_damage_radius, entity_radius, texture) function mobs:boom(self, pos, node_damage_radius, entity_radius, texture)
texture = texture or "mobs_tnt_smoke.png" texture = texture or "mobs_tnt_smoke.png"
if mobs_griefing and minetest.get_modpath("tnt") and tnt and tnt.boom if mobs_griefing then
and not minetest.is_protected(pos, "") then
if minetest.get_modpath("mcl_explosions") then
mcl_explosions.explode(pos, node_damage_radius)
elseif minetest.get_modpath("tnt") and tnt and tnt.boom then
tnt.boom(pos, { tnt.boom(pos, {
radius = node_damage_radius, radius = node_damage_radius,
@ -3950,6 +3955,7 @@ function mobs:boom(self, pos, node_damage_radius, entity_radius, texture)
explode_center = true, explode_center = true,
tiles = texture tiles = texture
}) })
end
else else
mobs:safe_boom(self, pos, node_damage_radius, texture) mobs:safe_boom(self, pos, node_damage_radius, texture)
end end