From 952a90bfde3665a48f9059fa3d73cb08eb6a5825 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Fri, 12 May 2023 23:45:11 +0100 Subject: [PATCH] Re-organise mob_step for better clarity --- mods/ENTITIES/mcl_mobs/api.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 323d25f10b..d4913305de 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -436,22 +436,23 @@ local function on_step_work (self, dtime) self:do_jump() end - self:check_aggro(dtime) - - self:check_particlespawners(dtime) - - if self.do_custom and self.do_custom(self, dtime) == false then return end - if mcl_util.check_dtime_timer(self, dtime, "onstep_occassional", 1) then - self:check_breeding() if player_in_active_range then self:check_item_pickup() self:set_armor_texture() self:step_opinion_sound(dtime) end + + self:check_breeding() end + self:check_aggro(dtime) + + self:check_particlespawners(dtime) + + if self.do_custom and self.do_custom(self, dtime) == false then return end + if self:do_states(dtime, player_in_active_range) then return end if mobs_debug then self:update_tag() end