From c2cb15a47f75674afaac721217384c8d7ead1c57 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Sat, 24 Apr 2021 18:36:22 -0400 Subject: [PATCH] Fix horse breeding --- .../mcl_mobs/api/mob_functions/breeding.lua | 6 +++++- mods/ENTITIES/mobs_mc/horse.lua | 13 ++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua index f71018aba..0f7470ac9 100644 --- a/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua +++ b/mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua @@ -160,7 +160,7 @@ mobs.make_baby_grow_faster = function(self,clicker) local stack = clicker:get_wielded_item() --safety check if not stack then - return + return(false) end local item_name = stack:get_name() @@ -172,6 +172,10 @@ mobs.make_baby_grow_faster = function(self,clicker) stack:take_item() clicker:set_wielded_item(stack) end + + return(true) end end + + return(false) end \ No newline at end of file diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index 3099f0f09..d030f4b36 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -219,18 +219,17 @@ local horse = { local heal = 0 --sneak click to breed the horse/feed it - if self.owner and self.owner == clicker:get_player_name() and clicker:get_player_control().sneak then + if self.owner and self.owner == clicker:get_player_name() then --attempt to enter breed state if mobs.enter_breed_state(self,clicker) then return end + end - --make baby grow faster - if self.baby then - mobs.make_baby_grow_faster(self,clicker) - return - end - + --don't do any other logic with the baby + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) return end