mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2025-01-08 01:00:25 +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} })
|
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.
|
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"} })
|
{"flowers:rose", "flowers:viola"} })
|
||||||
|
|
||||||
|
|
||||||
|
38
init.lua
38
init.lua
@ -180,26 +180,36 @@ local function check_crops(pos, nodename)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--helper tables
|
--helper tables ( "" denotes a blank item )
|
||||||
local green_grass = {
|
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 = {
|
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 = {
|
local flowers = {
|
||||||
"air", "flowers:dandelion_white", "flowers:dandelion_yellow",
|
"flowers:dandelion_white", "flowers:dandelion_yellow", "flowers:geranium",
|
||||||
"flowers:geranium", "flowers:rose", "flowers:tulip", "flowers:viola",
|
"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
|
-- default biomes deco
|
||||||
local deco = {
|
local deco = {
|
||||||
{"default:dirt_with_dry_grass", dry_grass, flowers},
|
{"default:dirt_with_dry_grass", dry_grass, flowers},
|
||||||
{"default:sand", {}, {"default:dry_shrub", "air", "air"} },
|
{"default:sand", {}, {"default:dry_shrub", "", ""} },
|
||||||
{"default:desert_sand", {}, {"default:dry_shrub", "air", "air"} },
|
{"default:desert_sand", {}, {"default:dry_shrub", "", "", ""} },
|
||||||
{"default:silver_sand", {}, {"default:dry_shrub", "air", "air"} },
|
{"default:silver_sand", {}, {"default:dry_shrub", "", "", ""} },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- add grass and flower/plant decoration for specific dirt types
|
-- add grass and flower/plant decoration for specific dirt types
|
||||||
@ -245,12 +255,16 @@ local function check_soil(pos, nodename)
|
|||||||
|
|
||||||
-- place random decoration (rare)
|
-- place random decoration (rare)
|
||||||
if math.random(1, 5) == 5 then
|
if math.random(1, 5) == 5 then
|
||||||
nod = decor[math.random(1, #decor)] or "air"
|
nod = decor[math.random(1, #decor)] or ""
|
||||||
minetest.swap_node(pos2, {name = nod})
|
if nod ~= "" then
|
||||||
|
minetest.set_node(pos2, {name = nod})
|
||||||
|
end
|
||||||
else
|
else
|
||||||
-- place random grass (common)
|
-- place random grass (common)
|
||||||
nod = grass[math.random(1, #grass)] or "air"
|
nod = grass[math.random(1, #grass)] or ""
|
||||||
minetest.swap_node(pos2, {name = nod})
|
if nod ~= "" then
|
||||||
|
minetest.set_node(pos2, {name = nod})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
particle_effect(pos2)
|
particle_effect(pos2)
|
||||||
|
4
mods.lua
4
mods.lua
@ -56,8 +56,8 @@ if minetest.get_modpath("ethereal") then
|
|||||||
})
|
})
|
||||||
|
|
||||||
bonemeal:add_deco({
|
bonemeal:add_deco({
|
||||||
{"ethereal:crystal_dirt", {"ethereal:crystalgrass", "air", "air", "air", "air"}, {}},
|
{"ethereal:crystal_dirt", {"ethereal:crystalgrass", "", "", "", ""}, {}},
|
||||||
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "air", "air", "air", "air"}, {}},
|
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "", "", "", ""}, {}},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user