2014-11-09 20:06:28 +01:00
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
-- Override grasses to drop seeds
|
2014-11-09 20:06:28 +01:00
|
|
|
|
2024-04-22 16:03:09 +02:00
|
|
|
local rarity_lookup = {[1] = 50, [2] = 50, [3] = 50, [4] = 5, [5] = 5}
|
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
if minetest.registered_nodes["default:grass_1"] then
|
2014-11-09 20:06:28 +01:00
|
|
|
|
2024-04-22 12:15:13 +02:00
|
|
|
for i = 1, 5 do
|
2023-09-01 11:04:33 +02:00
|
|
|
|
|
|
|
minetest.override_item("default:grass_" .. i, {
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2024-04-22 16:03:09 +02:00
|
|
|
{items = {"farming:seed_wheat"}, rarity = rarity_lookup[i]},
|
|
|
|
{items = {"farming:seed_oat"},rarity = rarity_lookup[i]},
|
2023-09-01 11:04:33 +02:00
|
|
|
{items = {"default:grass_1"}}
|
|
|
|
}
|
2014-11-09 20:06:28 +01:00
|
|
|
}
|
2023-09-01 11:04:33 +02:00
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
2014-11-09 20:06:28 +01:00
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
if minetest.registered_nodes["default:dry_grass_1"] then
|
2017-08-28 13:33:25 +02:00
|
|
|
|
2024-04-22 12:15:13 +02:00
|
|
|
for i = 1, 5 do
|
2016-03-10 18:45:55 +01:00
|
|
|
|
|
|
|
minetest.override_item("default:dry_grass_" .. i, {
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
2024-04-22 16:03:09 +02:00
|
|
|
{items = {"farming:seed_barley"}, rarity = rarity_lookup[i]},
|
|
|
|
{items = {"farming:seed_rye"}, rarity = rarity_lookup[i]},
|
2020-07-02 15:31:12 +02:00
|
|
|
{items = {"default:dry_grass_1"}}
|
2016-03-10 18:45:55 +01:00
|
|
|
}
|
2020-07-02 15:31:12 +02:00
|
|
|
}
|
2016-03-10 18:45:55 +01:00
|
|
|
})
|
|
|
|
end
|
2023-09-01 11:04:33 +02:00
|
|
|
end
|
2016-03-10 18:45:55 +01:00
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
if minetest.registered_nodes["default:junglegrass"] then
|
|
|
|
|
|
|
|
minetest.override_item("default:junglegrass", {
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
|
|
|
{items = {"farming:seed_cotton"}, rarity = 8},
|
|
|
|
{items = {"farming:seed_rice"}, rarity = 8},
|
|
|
|
{items = {"default:junglegrass"}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2014-11-09 20:06:28 +01:00
|
|
|
end
|
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
if farming.mcl then
|
2014-11-09 20:06:28 +01:00
|
|
|
|
2023-09-01 11:04:33 +02:00
|
|
|
minetest.override_item("mcl_flowers:tallgrass", {
|
|
|
|
drop = {
|
|
|
|
max_items = 1,
|
|
|
|
items = {
|
|
|
|
{items = {"mcl_farming:wheat_seeds"}, rarity = 5},
|
|
|
|
{items = {"farming:seed_oat"},rarity = 5},
|
|
|
|
{items = {"farming:seed_barley"}, rarity = 5},
|
|
|
|
{items = {"farming:seed_rye"},rarity = 5},
|
|
|
|
{items = {"farming:seed_cotton"}, rarity = 8},
|
|
|
|
{items = {"farming:seed_rice"},rarity = 8}
|
|
|
|
}
|
2014-11-09 20:06:28 +01:00
|
|
|
}
|
2023-09-01 11:04:33 +02:00
|
|
|
})
|
|
|
|
end
|
2024-07-13 08:20:07 +02:00
|
|
|
|