forked from mtcontrib/bonemeal
added nil check and ethereal fiery grass deco
This commit is contained in:
parent
64b4969311
commit
dddbaa6c81
17
init.lua
17
init.lua
@ -226,27 +226,28 @@ local function check_soil(pos, nodename)
|
|||||||
|
|
||||||
-- do we have a grass match?
|
-- do we have a grass match?
|
||||||
if nodename == deco[n][1] then
|
if nodename == deco[n][1] then
|
||||||
grass = deco[n][2]
|
grass = deco[n][2] or {}
|
||||||
decor = deco[n][3]
|
decor = deco[n][3] or {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pos2, nod
|
||||||
|
|
||||||
-- loop through soil
|
-- loop through soil
|
||||||
for _,n in pairs(dirt) do
|
for _,n in pairs(dirt) do
|
||||||
|
|
||||||
local pos2 = n
|
pos2 = n
|
||||||
|
|
||||||
pos2.y = pos2.y + 1
|
pos2.y = pos2.y + 1
|
||||||
|
|
||||||
-- 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"
|
||||||
minetest.swap_node(pos2,
|
minetest.swap_node(pos2, {name = nod})
|
||||||
{name = decor[math.random(1, #decor)]})
|
|
||||||
else
|
else
|
||||||
-- place random grass (common)
|
-- place random grass (common)
|
||||||
minetest.swap_node(pos2,
|
nod = grass[math.random(1, #grass)] or "air"
|
||||||
{name = grass[math.random(1, #grass)]})
|
minetest.swap_node(pos2, {name = nod})
|
||||||
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", "air", "air", "air", "air"}, {}},
|
||||||
{"ethereal:crystal_spike", "air", "air", "air", "air"}}
|
{"ethereal:fiery_dirt", {"ethereal:dry_shrub", "air", "air", "air", "air"}, {}},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user