1
0
Fork 0

Fix horse breeding

This commit is contained in:
jordan4ibanez 2021-04-24 18:36:22 -04:00
parent 39f7d0cf3c
commit c2cb15a47f
2 changed files with 11 additions and 8 deletions

View File

@ -160,7 +160,7 @@ mobs.make_baby_grow_faster = function(self,clicker)
local stack = clicker:get_wielded_item() local stack = clicker:get_wielded_item()
--safety check --safety check
if not stack then if not stack then
return return(false)
end end
local item_name = stack:get_name() local item_name = stack:get_name()
@ -172,6 +172,10 @@ mobs.make_baby_grow_faster = function(self,clicker)
stack:take_item() stack:take_item()
clicker:set_wielded_item(stack) clicker:set_wielded_item(stack)
end end
return(true)
end end
end end
return(false)
end end

View File

@ -219,18 +219,17 @@ local horse = {
local heal = 0 local heal = 0
--sneak click to breed the horse/feed it --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 --attempt to enter breed state
if mobs.enter_breed_state(self,clicker) then if mobs.enter_breed_state(self,clicker) then
return return
end end
end
--make baby grow faster --don't do any other logic with the baby
if self.baby then --make baby grow faster
mobs.make_baby_grow_faster(self,clicker) if self.baby then
return mobs.make_baby_grow_faster(self,clicker)
end
return return
end end