Fix sheep getting horny from eating grass
This commit is contained in:
parent
fce8fd605d
commit
1ebe4d44f6
@ -1722,7 +1722,7 @@ end
|
|||||||
|
|
||||||
-- Feeding, taming and breeding (thanks blert2112)
|
-- Feeding, taming and breeding (thanks blert2112)
|
||||||
|
|
||||||
function mobs:feed_tame(self, clicker, feed_count, breed)
|
function mobs:feed_tame(self, clicker, feed_count, breed, effect)
|
||||||
-- Feed a mob(mostly a wrapper to handle self.check_fed)
|
-- Feed a mob(mostly a wrapper to handle self.check_fed)
|
||||||
|
|
||||||
local item = nil
|
local item = nil
|
||||||
@ -1747,25 +1747,27 @@ function mobs:feed_tame(self, clicker, feed_count, breed)
|
|||||||
clicker:set_wielded_item(item)
|
clicker:set_wielded_item(item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mob_sound(self, self.sounds.eat, true)
|
|
||||||
|
|
||||||
local mobpos = self.object:get_pos()
|
if effect ~= false then
|
||||||
minetest.add_particlespawner(
|
mob_sound(self, self.sounds.eat, true)
|
||||||
{
|
local mobpos = self.object:get_pos()
|
||||||
amount = 10,
|
minetest.add_particlespawner(
|
||||||
time = 0.1,
|
{
|
||||||
minpos = {x = mobpos.x - 0.1, y = mobpos.y - 0.1, z = mobpos.z - 0.1},
|
amount = 10,
|
||||||
maxpos = {x = mobpos.x + 0.1, y = mobpos.y + 0.1, z = mobpos.z + 0.1},
|
time = 0.1,
|
||||||
minvel = {x = -1, y = -1, z = -1},
|
minpos = {x = mobpos.x - 0.1, y = mobpos.y - 0.1, z = mobpos.z - 0.1},
|
||||||
maxvel = {x = 1, y = 0, z = 1},
|
maxpos = {x = mobpos.x + 0.1, y = mobpos.y + 0.1, z = mobpos.z + 0.1},
|
||||||
minacc = {x = 0, y = 6, z = 0},
|
minvel = {x = -1, y = -1, z = -1},
|
||||||
maxacc = {x = 0, y = 1, z = 0},
|
maxvel = {x = 1, y = 0, z = 1},
|
||||||
minexptime = 0.5,
|
minacc = {x = 0, y = 6, z = 0},
|
||||||
maxexptime = 1,
|
maxacc = {x = 0, y = 1, z = 0},
|
||||||
minsize = 0.5,
|
minexptime = 0.5,
|
||||||
maxsize = 2,
|
maxexptime = 1,
|
||||||
texture = "magicpuff.png"
|
minsize = 0.5,
|
||||||
})
|
maxsize = 2,
|
||||||
|
texture = "magicpuff.png"
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
self:check_fed(name, feed_count, breed)
|
self:check_fed(name, feed_count, breed)
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ mobs:register_mob(
|
|||||||
on_replace = function(self, pos)
|
on_replace = function(self, pos)
|
||||||
minetest.set_node(pos, {name = self.replace_with})
|
minetest.set_node(pos, {name = self.replace_with})
|
||||||
|
|
||||||
if mobs:feed_tame(self, self.follow, 8, true) then
|
if mobs:feed_tame(self, self.follow, 8, false, false) then
|
||||||
if self.gotten == false then
|
if self.gotten == false then
|
||||||
self.object:set_properties(
|
self.object:set_properties(
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user