diff --git a/mods/ENTITIES/mcl_mobs/effects.lua b/mods/ENTITIES/mcl_mobs/effects.lua index cf48551f1..9205c80db 100644 --- a/mods/ENTITIES/mcl_mobs/effects.lua +++ b/mods/ENTITIES/mcl_mobs/effects.lua @@ -250,9 +250,7 @@ end -- set defined animation function mob_class:set_animation(anim, fixed_frame) - if not self.animation or not anim then - return - end + if not self.animation or not anim then return end if self.jockey and self.object:get_attach() then anim = "jockey" @@ -260,11 +258,7 @@ function mob_class:set_animation(anim, fixed_frame) self.jockey = nil end - if self.state == "die" and anim ~= "die" and anim ~= "stand" then - return - end - - + if self.state == "die" and anim ~= "die" and anim ~= "stand" then return end if self.fly and self:flight_check() and anim == "walk" then anim = "fly" end @@ -279,12 +273,7 @@ function mob_class:set_animation(anim, fixed_frame) self._current_animation = anim local a_start = self.animation[anim .. "_start"] - local a_end - if fixed_frame then - a_end = a_start - else - a_end = self.animation[anim .. "_end"] - end + local a_end = fixed_frame and a_start or self.animation[anim .. "_end"] if a_start and a_end then self.object:set_animation({ x = a_start, @@ -294,11 +283,6 @@ function mob_class:set_animation(anim, fixed_frame) end end --- above function exported for mount.lua -function mcl_mobs:set_animation(self, anim) - self:set_animation(anim) -end - local function who_are_you_looking_at (self, dtime) if self.order == "sleep" then self._locked_object = nil diff --git a/mods/ENTITIES/mcl_mobs/mount.lua b/mods/ENTITIES/mcl_mobs/mount.lua index 750b3f9f4..fdc499440 100644 --- a/mods/ENTITIES/mcl_mobs/mount.lua +++ b/mods/ENTITIES/mcl_mobs/mount.lua @@ -142,10 +142,10 @@ function mcl_mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) -- if not moving then set animation and return if v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then - if stand_anim then mcl_mobs:set_animation(entity, stand_anim) end + entity:set_animation(stand_anim) return else - if moving_anim then mcl_mobs:set_animation(entity, moving_anim) end + entity:set_animation(moving_anim) end -- enforce speed limit forward and reverse @@ -254,9 +254,9 @@ function mcl_mobs.fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_an -- change animation if stopped if velo.x == 0 and velo.y == 0 and velo.z == 0 then - if stand_anim then mcl_mobs:set_animation(entity, stand_anim) end + entity:set_animation(stand_anim) else - if moving_anim then mcl_mobs:set_animation(entity, moving_anim) end + entity:set_animation(moving_anim) end end diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index d257cda5d..8499006f7 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -295,11 +295,6 @@ function mob_class:check_smooth_rotation(dtime) self:update_roll() end --- global function to set mob yaw -function mcl_mobs.yaw(self, yaw, delay, dtime) - return mob_class.set_yaw(self, yaw, delay, dtime) -end - -- are we flying in what we are suppose to? (taikedz) function mob_class:flight_check() diff --git a/mods/ENTITIES/mobs_mc/shulker.lua b/mods/ENTITIES/mobs_mc/shulker.lua index 78959b717..9280ef982 100644 --- a/mods/ENTITIES/mobs_mc/shulker.lua +++ b/mods/ENTITIES/mobs_mc/shulker.lua @@ -83,7 +83,6 @@ mcl_mobs.register_mob("mobs_mc:shulker", { local pos = self.object:get_pos() if math.floor(self.object:get_yaw()) ~=0 then self.object:set_yaw(0) - mcl_mobs:yaw(self, 0, 0, dtime) end if self.state == "attack" then self:set_animation("run")