mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-04 08:43:45 +01:00
add lightning API support for mobs
parent
03829dd518
commit
0584d16569
@ -156,6 +156,10 @@ lightning.register_on_strike(function(pos, pos2, objects)
|
|||||||
-- damage nearby objects, transform mobs
|
-- damage nearby objects, transform mobs
|
||||||
for _, obj in pairs(objects) do
|
for _, obj in pairs(objects) do
|
||||||
local lua = obj:get_luaentity()
|
local lua = obj:get_luaentity()
|
||||||
|
if lua and lua._on_strike then
|
||||||
|
lua._on_strike(lua, pos, pos2, objects)
|
||||||
|
end
|
||||||
|
-- remove this when mob API is done
|
||||||
if lua and lua.name == "mobs_mc:pig" then
|
if lua and lua.name == "mobs_mc:pig" then
|
||||||
mcl_util.replace_mob(obj, "mobs_mc:pigman")
|
mcl_util.replace_mob(obj, "mobs_mc:pigman")
|
||||||
elseif lua and lua.name == "mobs_mc:mooshroom" then
|
elseif lua and lua.name == "mobs_mc:mooshroom" then
|
||||||
|
Loading…
Reference in New Issue
Block a user