Make sure bred pig and sheep stay tamed and owned

This commit is contained in:
Wuzzy 2018-05-31 17:32:13 +02:00
parent c55714ea0c
commit 9afe5da7b4
2 changed files with 7 additions and 1 deletions

@ -171,7 +171,11 @@ mobs:register_mob("mobs_mc:pig", {
on_breed = function(parent1, parent2)
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
end
end,

@ -248,6 +248,8 @@ mobs:register_mob("mobs_mc:sheep", {
end
child:set_properties({textures = ent_c.base_texture})
ent_c.initial_color_set = true
ent_c.tamed = true
ent_c.owner = parent1.owner
return false
end
end,