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 .. "death_logic.lua")
dofile(api_path .. "mob_effects.lua") dofile(api_path .. "mob_effects.lua")
dofile(api_path .. "projectile_handling.lua") dofile(api_path .. "projectile_handling.lua")
dofile(api_path .. "breeding.lua")
mobs.spawning_mobs = {} mobs.spawning_mobs = {}

View file

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

View file

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

View file

@ -50,7 +50,9 @@ local cow_def = {
}, },
follow = mobs_mc.follow.cow, follow = mobs_mc.follow.cow,
on_rightclick = function(self, clicker) 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 if self.child then
return return