diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 8a40d2eb2..8bee4e3f0 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -429,6 +429,13 @@ function mob_class:on_step(dtime) end end + if self._just_portaled then + self._just_portaled = self._just_portaled - dtime + if self._just_portaled < 0 then + self._just_portaled = nil + end + end + if update_timers(self, dtime) then return end self:check_particlespawners(dtime) diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index 4ccf8baaa..026e2da4a 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -900,15 +900,13 @@ function mob_class:falling(pos) return end - if mcl_portals ~= nil then - if mcl_portals.nether_portal_cooloff(self.object) then - return false -- mob has teleported through Nether portal - it's 99% not falling - end + local v = self.object:get_velocity() + if self._just_portaled then + self.reset_fall_damage = 1 + return false -- mob has teleported through portal - it's 99% not falling end -- floating in water (or falling) - local v = self.object:get_velocity() - if v.y > 0 then -- apply gravity when moving up diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index f765847ee..a4a9313d4 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -234,6 +234,11 @@ function mcl_portals.end_teleport(obj, pos) end mcl_worlds.dimension_change(obj, mcl_worlds.pos_to_dimension(target)) minetest.sound_play("mcl_portals_teleport", {pos=target, gain=0.5, max_hear_distance = 16}, true) + else + local l = obj:get_luaentity() + if l and l.is_mob then + l._just_portaled = 5 + end end end diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 890d13bc7..5aa6adac3 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -395,6 +395,11 @@ local function finalize_teleport(obj, pos, old_param2, new_param2) minetest.sound_play("mcl_portals_teleport", {pos = pos, gain = 0.5, max_hear_distance = 1}, true) mcl_worlds.dimension_change(obj) minetest.log("action", "[mcl_portal] " .. obj:get_player_name() .. " teleported to " .. tostring(pos)) + else + local l = obj:get_luaentity() + if l and l.is_mob then + l._just_portaled = 5 + end end teleport_finished(obj)