mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-26 21:03:45 +01:00
Make sure bred pig and sheep stay tamed and owned
parent
c55714ea0c
commit
9afe5da7b4
@ -171,7 +171,11 @@ mobs:register_mob("mobs_mc:pig", {
|
|||||||
|
|
||||||
on_breed = function(parent1, parent2)
|
on_breed = function(parent1, parent2)
|
||||||
local pos = parent1.object:get_pos()
|
local pos = parent1.object:get_pos()
|
||||||
if mobs:spawn_child(pos, parent1.name) then
|
local child = mobs:spawn_child(pos, parent1.name)
|
||||||
|
if child then
|
||||||
|
local ent_c = child:get_luaentity()
|
||||||
|
ent_c.tamed = true
|
||||||
|
ent_c.owner = parent1.owner
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -248,6 +248,8 @@ mobs:register_mob("mobs_mc:sheep", {
|
|||||||
end
|
end
|
||||||
child:set_properties({textures = ent_c.base_texture})
|
child:set_properties({textures = ent_c.base_texture})
|
||||||
ent_c.initial_color_set = true
|
ent_c.initial_color_set = true
|
||||||
|
ent_c.tamed = true
|
||||||
|
ent_c.owner = parent1.owner
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
Loading…
Reference in New Issue
Block a user