forked from nalc/nalc_game
Tweak mushroom drops
-> Don't always drop the main mushroom (allowed endless spore generation loop before) -> Drop less spores, before you got lots of spores
This commit is contained in:
parent
6194f9ffea
commit
7066a6a0dd
|
@ -85,23 +85,23 @@ minetest.register_abm({
|
||||||
elseif under.name ~= "default:dirt_with_grass" then
|
elseif under.name ~= "default:dirt_with_grass" then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local light = minetest.get_node_light(pos)
|
local light = minetest.get_node_light(pos)
|
||||||
if not light or light < 13 then
|
if not light or light < 13 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
|
local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
|
||||||
local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
|
local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
|
||||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
||||||
if #flowers > 3 then
|
if #flowers > 3 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
||||||
if #seedling > 0 then
|
if #seedling > 0 then
|
||||||
seedling = seedling[math.random(#seedling)]
|
seedling = seedling[math.random(#seedling)]
|
||||||
|
@ -145,11 +145,12 @@ for _, m in pairs(mushrooms_datas) do
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flammable = 3, attached_node = 1},
|
groups = {snappy = 3, flammable = 3, attached_node = 1},
|
||||||
drop = {
|
drop = {
|
||||||
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {"flowers:mushroom_spores_" .. name}, rarity = 2,},
|
{items = {"flowers:mushroom_" .. name}, rarity = 2,},
|
||||||
{items = {"flowers:mushroom_spores_" .. name}, rarity = 2,},
|
{items = {"flowers:mushroom_spores_" .. name}, rarity = 3,},
|
||||||
{items = {"flowers:mushroom_spores_" .. name}, rarity = 2,},
|
{items = {"flowers:mushroom_spores_" .. name .. " 2"}, rarity = 2,},
|
||||||
{items = {"flowers:mushroom_" .. name},},
|
{items = {"flowers:mushroom_spores_" .. name .. " 3"}, rarity = 2,},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user