Added on_save_effect support for mobs

This commit is contained in:
the-real-herowl 2024-04-22 02:26:26 +02:00
parent e806d5f3ce
commit 63b2da7aa0
1 changed files with 6 additions and 0 deletions

View File

@ -109,6 +109,12 @@ function mob_class:get_staticdata()
end
tmp._mcl_potions = self._mcl_potions
if tmp._mcl_potions then
for name_raw, data in pairs(tmp._mcl_potions) do
local def = mcl_potions.registered_effects[name_raw:match("^_EF_(.+)$")]
if def and def.on_save_effect then def.on_save_effect(self.object) end
end
end
return minetest.serialize(tmp)
end