mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2024-12-23 01:10:25 +01:00
sheeps wont drop wool when killed if sheared (thx Mazes)
This commit is contained in:
parent
ad9269569c
commit
840291ee5b
17
sheep.lua
17
sheep.lua
@ -24,6 +24,15 @@ local all_colours = {
|
|||||||
|
|
||||||
for _, col in ipairs(all_colours) do
|
for _, col in ipairs(all_colours) do
|
||||||
|
|
||||||
|
local drops_normal = {
|
||||||
|
{name = "mobs:mutton_raw", chance = 1, min = 1, max = 2},
|
||||||
|
{name = "wool:" .. col[1], chance = 1, min = 1, max = 1}
|
||||||
|
}
|
||||||
|
|
||||||
|
local drops_gotten = {
|
||||||
|
{name = "mobs:mutton_raw", chance = 1, min = 1, max = 2}
|
||||||
|
}
|
||||||
|
|
||||||
mobs:register_mob("mobs_animal:sheep_"..col[1], {
|
mobs:register_mob("mobs_animal:sheep_"..col[1], {
|
||||||
stay_near = {"farming:straw", 10},
|
stay_near = {"farming:straw", 10},
|
||||||
stepheight = 0.6,
|
stepheight = 0.6,
|
||||||
@ -50,10 +59,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
jump = true,
|
jump = true,
|
||||||
jump_height = 6,
|
jump_height = 6,
|
||||||
pushable = true,
|
pushable = true,
|
||||||
drops = {
|
drops = drops_normal,
|
||||||
{name = "mobs:mutton_raw", chance = 1, min = 1, max = 2},
|
|
||||||
{name = "wool:"..col[1], chance = 1, min = 1, max = 1}
|
|
||||||
},
|
|
||||||
water_damage = 0,
|
water_damage = 0,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
@ -91,6 +97,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
|
|
||||||
self.food = 0
|
self.food = 0
|
||||||
self.gotten = false
|
self.gotten = false
|
||||||
|
self.drops = drops_normal
|
||||||
|
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
textures = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
|
textures = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
|
||||||
@ -107,6 +114,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
if self.food and self.food > 6 then
|
if self.food and self.food > 6 then
|
||||||
|
|
||||||
self.gotten = false
|
self.gotten = false
|
||||||
|
self.drops = drops_normal
|
||||||
|
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
textures = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
|
textures = {"mobs_sheep_base.png^(mobs_sheep_wool.png^[colorize:" .. col[3] .. ")"},
|
||||||
@ -132,6 +140,7 @@ for _, col in ipairs(all_colours) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
self.gotten = true -- shaved
|
self.gotten = true -- shaved
|
||||||
|
self.drops = drops_gotten
|
||||||
|
|
||||||
local obj = minetest.add_item(
|
local obj = minetest.add_item(
|
||||||
self.object:get_pos(),
|
self.object:get_pos(),
|
||||||
|
Loading…
Reference in New Issue
Block a user