From 63b2da7aa0cd3a572a728ff3feecff764209dbf9 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 22 Apr 2024 02:26:26 +0200 Subject: [PATCH] Added on_save_effect support for mobs --- mods/ENTITIES/mcl_mobs/api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 37db6b46e..873d05bf2 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -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