From 0568c14a435e663dccc1a42ae999a76d0936f153 Mon Sep 17 00:00:00 2001 From: jordan4ibanez Date: Fri, 23 Apr 2021 23:59:35 -0400 Subject: [PATCH] Fix timer and make mooshroom breedable --- mods/ENTITIES/mcl_mobs/api/api.lua | 1 + mods/ENTITIES/mobs_mc/cow+mooshroom.lua | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/api.lua b/mods/ENTITIES/mcl_mobs/api/api.lua index ac771164e..1fc3edf46 100644 --- a/mods/ENTITIES/mcl_mobs/api/api.lua +++ b/mods/ENTITIES/mcl_mobs/api/api.lua @@ -342,6 +342,7 @@ function mobs:register_mob(name, def) baby = false, grow_up_timer = 0, grow_up_goal = 20*60, --in 20 minutes the mob grows up + special_breed_timer = 0, --this is used for the AHEM AHEM part of breeding backup_visual_size = def.visual_size, backup_collisionbox = collisionbox, diff --git a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua index 87e6f2552..41befd809 100644 --- a/mods/ENTITIES/mobs_mc/cow+mooshroom.lua +++ b/mods/ENTITIES/mobs_mc/cow+mooshroom.lua @@ -56,9 +56,9 @@ local cow_def = { return end + --make baby grow faster if self.baby then mobs.make_baby_grow_faster(self,clicker) - --do child timer thing %10 return end @@ -95,11 +95,17 @@ local mooshroom_def = table.copy(cow_def) mooshroom_def.mesh = "mobs_mc_cow.b3d" mooshroom_def.textures = { {"mobs_mc_mooshroom.png", "mobs_mc_mushroom_red.png"}, {"mobs_mc_mooshroom_brown.png", "mobs_mc_mushroom_brown.png" } } mooshroom_def.on_rightclick = function(self, clicker) - if mobs:feed_tame(self, clicker, 1, true, true) then return end - - if self.child then + --attempt to enter breed state + if mobs.enter_breed_state(self,clicker) then return end + + --make baby grow faster + if self.baby then + mobs.make_baby_grow_faster(self,clicker) + return + end + local item = clicker:get_wielded_item() -- Use shears to get mushrooms and turn mooshroom into cow if item:get_name() == mobs_mc.items.shears then