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,21 +219,20 @@ 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
--don't do any other logic with the baby
--make baby grow faster --make baby grow faster
if self.baby then if self.baby then
mobs.make_baby_grow_faster(self,clicker) mobs.make_baby_grow_faster(self,clicker)
return return
end end
return
end
-- Taming -- Taming
self.temper = self.temper or (math.random(1,100)) self.temper = self.temper or (math.random(1,100))