move on_blast default to mob default def
parent
28b6fcf289
commit
19d6d43b39
|
@ -520,15 +520,7 @@ function mob_class:on_step(dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- default function when mobs are blown up with TNT
|
|
||||||
local function do_tnt(self,damage)
|
|
||||||
self.object:punch(self.object, 1.0, {
|
|
||||||
full_punch_interval = 1.0,
|
|
||||||
damage_groups = {fleshy = damage},
|
|
||||||
}, nil)
|
|
||||||
|
|
||||||
return false, true, {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local timer = 0
|
local timer = 0
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
|
|
|
@ -280,9 +280,14 @@ minetest.register_entity(name, setmetatable({
|
||||||
noyaw = def.noyaw or false,
|
noyaw = def.noyaw or false,
|
||||||
particlespawners = def.particlespawners,
|
particlespawners = def.particlespawners,
|
||||||
-- End of MCL2 extensions
|
-- End of MCL2 extensions
|
||||||
|
|
||||||
on_spawn = def.on_spawn,
|
on_spawn = def.on_spawn,
|
||||||
on_blast = def.on_blast or do_tnt,
|
on_blast = def.on_blast or function(self,damage)
|
||||||
|
self.object:punch(self.object, 1.0, {
|
||||||
|
full_punch_interval = 1.0,
|
||||||
|
damage_groups = {fleshy = damage},
|
||||||
|
}, nil)
|
||||||
|
return false, true, {}
|
||||||
|
end,
|
||||||
do_punch = def.do_punch,
|
do_punch = def.do_punch,
|
||||||
on_breed = def.on_breed,
|
on_breed = def.on_breed,
|
||||||
on_grown = def.on_grown,
|
on_grown = def.on_grown,
|
||||||
|
|
Loading…
Reference in New Issue