mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2024-11-13 03:30:18 +01:00
added bakedclay flowers to decoration
This commit is contained in:
parent
3b185e0099
commit
b0aa729329
5
api.txt
5
api.txt
|
@ -45,11 +45,12 @@ Adding Dirt Decoration
|
|||
|
||||
bonemeal:add_deco({ dirt_node, {grass_node_list}, {decor_node_list} })
|
||||
|
||||
This command will add grass and decoration to specific dirt types.
|
||||
This command will add grass and decoration to specific dirt types, use "" to
|
||||
add an empty node.
|
||||
|
||||
e.g.
|
||||
|
||||
bonemeal:add_deco({"default:dirt_with_dry_grass", {"default:dry_grass_1", "air"},
|
||||
bonemeal:add_deco({"default:dirt_with_dry_grass", {"default:dry_grass_1", ""},
|
||||
{"flowers:rose", "flowers:viola"} })
|
||||
|
||||
|
||||
|
|
38
init.lua
38
init.lua
|
@ -180,26 +180,36 @@ local function check_crops(pos, nodename)
|
|||
|
||||
end
|
||||
|
||||
--helper tables
|
||||
--helper tables ( "" denotes a blank item )
|
||||
local green_grass = {
|
||||
"default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"
|
||||
"default:grass_2", "default:grass_3", "default:grass_4",
|
||||
"default:grass_5", "", ""
|
||||
}
|
||||
|
||||
local dry_grass = {
|
||||
"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"
|
||||
"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
|
||||
"default:dry_grass_5", "", ""
|
||||
}
|
||||
|
||||
local flowers = {
|
||||
"air", "flowers:dandelion_white", "flowers:dandelion_yellow",
|
||||
"flowers:geranium", "flowers:rose", "flowers:tulip", "flowers:viola",
|
||||
"flowers:dandelion_white", "flowers:dandelion_yellow", "flowers:geranium",
|
||||
"flowers:rose", "flowers:tulip", "flowers:viola", ""
|
||||
}
|
||||
|
||||
-- add additional bakedclay flowers if enabled
|
||||
if minetest.get_modpath("bakedclay") then
|
||||
flowers[7] = "bakedclay:delphinium"
|
||||
flowers[8] = "bakedclay:thistle"
|
||||
flowers[9] = "bakedclay:lazarus"
|
||||
flowers[10] = "bakedclay:mannagrass"
|
||||
end
|
||||
|
||||
-- default biomes deco
|
||||
local deco = {
|
||||
{"default:dirt_with_dry_grass", dry_grass, flowers},
|
||||
{"default:sand", {}, {"default:dry_shrub", "air", "air"} },
|
||||
{"default:desert_sand", {}, {"default:dry_shrub", "air", "air"} },
|
||||
{"default:silver_sand", {}, {"default:dry_shrub", "air", "air"} },
|
||||
{"default:sand", {}, {"default:dry_shrub", "", ""} },
|
||||
{"default:desert_sand", {}, {"default:dry_shrub", "", "", ""} },
|
||||
{"default:silver_sand", {}, {"default:dry_shrub", "", "", ""} },
|
||||
}
|
||||
|
||||
-- add grass and flower/plant decoration for specific dirt types
|
||||
|
@ -245,12 +255,16 @@ local function check_soil(pos, nodename)
|
|||
|
||||
-- place random decoration (rare)
|
||||
if math.random(1, 5) == 5 then
|
||||
nod = decor[math.random(1, #decor)] or "air"
|
||||
minetest.swap_node(pos2, {name = nod})
|
||||
nod = decor[math.random(1, #decor)] or ""
|
||||
if nod ~= "" then
|
||||
minetest.set_node(pos2, {name = nod})
|
||||
end
|
||||
else
|
||||
-- place random grass (common)
|
||||
nod = grass[math.random(1, #grass)] or "air"
|
||||
minetest.swap_node(pos2, {name = nod})
|
||||
nod = grass[math.random(1, #grass)] or ""
|
||||
if nod ~= "" then
|
||||
minetest.set_node(pos2, {name = nod})
|
||||
end
|
||||
end
|
||||
|
||||
particle_effect(pos2)
|
||||
|
|
4
mods.lua
4
mods.lua
|
@ -56,8 +56,8 @@ if minetest.get_modpath("ethereal") then
|
|||
})
|
||||
|
||||
bonemeal:add_deco({
|
||||
{"ethereal:crystal_dirt", {"ethereal:crystalgrass", "air", "air", "air", "air"}, {}},
|
||||
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "air", "air", "air", "air"}, {}},
|
||||
{"ethereal:crystal_dirt", {"ethereal:crystalgrass", "", "", "", ""}, {}},
|
||||
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "", "", "", ""}, {}},
|
||||
})
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user