Fix sheep getting horny from eating grass

This commit is contained in:
Wuzzy 2021-08-08 15:07:10 +02:00
parent fce8fd605d
commit 1ebe4d44f6
2 changed files with 22 additions and 20 deletions

View File

@ -1722,7 +1722,7 @@ end
-- 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)
local item = nil
@ -1747,25 +1747,27 @@ function mobs:feed_tame(self, clicker, feed_count, breed)
clicker:set_wielded_item(item)
end
end
mob_sound(self, self.sounds.eat, true)
local mobpos = self.object:get_pos()
minetest.add_particlespawner(
{
amount = 10,
time = 0.1,
minpos = {x = mobpos.x - 0.1, y = mobpos.y - 0.1, z = mobpos.z - 0.1},
maxpos = {x = mobpos.x + 0.1, y = mobpos.y + 0.1, z = mobpos.z + 0.1},
minvel = {x = -1, y = -1, z = -1},
maxvel = {x = 1, y = 0, z = 1},
minacc = {x = 0, y = 6, z = 0},
maxacc = {x = 0, y = 1, z = 0},
minexptime = 0.5,
maxexptime = 1,
minsize = 0.5,
maxsize = 2,
texture = "magicpuff.png"
})
if effect ~= false then
mob_sound(self, self.sounds.eat, true)
local mobpos = self.object:get_pos()
minetest.add_particlespawner(
{
amount = 10,
time = 0.1,
minpos = {x = mobpos.x - 0.1, y = mobpos.y - 0.1, z = mobpos.z - 0.1},
maxpos = {x = mobpos.x + 0.1, y = mobpos.y + 0.1, z = mobpos.z + 0.1},
minvel = {x = -1, y = -1, z = -1},
maxvel = {x = 1, y = 0, z = 1},
minacc = {x = 0, y = 6, z = 0},
maxacc = {x = 0, y = 1, z = 0},
minexptime = 0.5,
maxexptime = 1,
minsize = 0.5,
maxsize = 2,
texture = "magicpuff.png"
})
end
self:check_fed(name, feed_count, breed)

View File

@ -65,7 +65,7 @@ mobs:register_mob(
on_replace = function(self, pos)
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
self.object:set_properties(
{