mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-23 02:51:06 +01:00
Set up basics for breeding mechanics
This commit is contained in:
parent
5ee6cf6c9b
commit
fcfd6b9d19
5 changed files with 6 additions and 3 deletions
|
@ -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 = {}
|
||||||
|
|
|
@ -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
|
||||||
|
|
0
mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua
Normal file
0
mods/ENTITIES/mcl_mobs/api/mob_functions/breeding.lua
Normal 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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue