forked from MineClone5/MineClone5
Set up basics for breeding mechanics
This commit is contained in:
parent
5ee6cf6c9b
commit
fcfd6b9d19
|
@ -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 = {}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue