Set up basics for breeding mechanics

This commit is contained in:
jordan4ibanez 2021-04-23 21:14:23 -04:00
parent 5ee6cf6c9b
commit fcfd6b9d19
5 changed files with 6 additions and 3 deletions

View File

@ -164,6 +164,7 @@ dofile(api_path .. "sound_handling.lua")
dofile(api_path .. "death_logic.lua")
dofile(api_path .. "mob_effects.lua")
dofile(api_path .. "projectile_handling.lua")
dofile(api_path .. "breeding.lua")
mobs.spawning_mobs = {}

View File

@ -698,7 +698,7 @@ mobs.mob_step = function(self, dtime)
--despawn mechanism
--don't despawned tamed mobs
if not self.tamed then
if not self.tamed and not self.bred then
self.lifetimer = self.lifetimer - dtime
if self.lifetimer <= 0 then
self.lifetimer = self.lifetimer_reset

View File

@ -7,7 +7,7 @@ mobs.mob_staticdata = function(self)
--despawn mechanism
--don't despawned tamed mobs
if not self.tamed then
if not self.tamed and not self.bred then
if not mobs.check_for_player_within_area(self, 64) then
--print("removing SERIALIZED!")
self.object:remove()

View File

@ -50,7 +50,9 @@ local cow_def = {
},
follow = mobs_mc.follow.cow,
on_rightclick = function(self, clicker)
if mobs:feed_tame(self, clicker, 1, true, true) then return end
if mobs:feed_tame(self, clicker, 1, true, true) then
return
end
if self.child then
return