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:
parent
24adcae920
commit
68b25c9d08
26
api.lua
26
api.lua
@ -3934,22 +3934,28 @@ 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
|
|
||||||
|
|
||||||
tnt.boom(pos, {
|
if minetest.get_modpath("mcl_explosions") then
|
||||||
radius = node_damage_radius,
|
|
||||||
damage_radius = entity_radius,
|
mcl_explosions.explode(pos, node_damage_radius)
|
||||||
sound = self and self.sounds and self.sounds.explode or "tnt_explode",
|
|
||||||
explode_center = true,
|
elseif minetest.get_modpath("tnt") and tnt and tnt.boom then
|
||||||
tiles = texture
|
|
||||||
})
|
tnt.boom(pos, {
|
||||||
|
radius = node_damage_radius,
|
||||||
|
damage_radius = entity_radius,
|
||||||
|
sound = self and self.sounds and self.sounds.explode or "tnt_explode",
|
||||||
|
explode_center = true,
|
||||||
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user