summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-01-16 20:52:26 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-01-16 20:52:26 +0000
commitdddbaa6c8172011eb3b133a2d39d005081f71d1a (patch)
treef901eb866635b79dab66fb78f6307d36a474b5e4
parent64b496931139a0c6bc33f15dad5483b19277d39c (diff)
added nil check and ethereal fiery grass deco
-rw-r--r--init.lua17
-rw-r--r--mods.lua4
2 files changed, 11 insertions, 10 deletions
diff --git a/init.lua b/init.lua
index 429f9f1..657bc16 100644
--- a/init.lua
+++ b/init.lua
@@ -226,27 +226,28 @@ local function check_soil(pos, nodename)
-- do we have a grass match?
if nodename == deco[n][1] then
- grass = deco[n][2]
- decor = deco[n][3]
+ grass = deco[n][2] or {}
+ decor = deco[n][3] or {}
end
end
+ local pos2, nod
+
-- loop through soil
for _,n in pairs(dirt) do
- local pos2 = n
+ pos2 = n
pos2.y = pos2.y + 1
-- place random decoration (rare)
if math.random(1, 5) == 5 then
-
- minetest.swap_node(pos2,
- {name = decor[math.random(1, #decor)]})
+ nod = decor[math.random(1, #decor)] or "air"
+ minetest.swap_node(pos2, {name = nod})
else
-- place random grass (common)
- minetest.swap_node(pos2,
- {name = grass[math.random(1, #grass)]})
+ nod = grass[math.random(1, #grass)] or "air"
+ minetest.swap_node(pos2, {name = nod})
end
particle_effect(pos2)
diff --git a/mods.lua b/mods.lua
index 69c1c4d..a59fda7 100644
--- a/mods.lua
+++ b/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:crystal_spike", "air", "air", "air", "air"}}
+ {"ethereal:crystal_dirt", {"ethereal:crystalgrass", "air", "air", "air", "air"}, {}},
+ {"ethereal:fiery_dirt", {"ethereal:dry_shrub", "air", "air", "air", "air"}, {}},
})
end