Extra error checking.
This commit is contained in:
parent
aa999e2ed5
commit
bf26b8bee1
25 changed files with 897 additions and 314 deletions
|
@ -1,5 +1,9 @@
|
|||
fun_caves.water_plants = {}
|
||||
local function register_water_plant(desc)
|
||||
if not (desc and type(desc) == 'table') then
|
||||
return
|
||||
end
|
||||
|
||||
fun_caves.water_plants[#fun_caves.water_plants+1] = desc
|
||||
end
|
||||
|
||||
|
@ -129,6 +133,10 @@ for _, plant in ipairs(fun_caves.plantlist) do
|
|||
},
|
||||
sounds = plant.sounds or default.node_sound_leaves_defaults(),
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if not (pos and oldnode) then
|
||||
return
|
||||
end
|
||||
|
||||
local replacement = oldnode.name:gsub('.*_water_(.*)', 'default:%1')
|
||||
if replacement:find('cloud$') then
|
||||
replacement = replacement:gsub('^default', 'fun_caves')
|
||||
|
@ -151,6 +159,10 @@ end
|
|||
|
||||
|
||||
local function register_flower(name, seed, biomes)
|
||||
if not (name and seed and biomes and type(name) == 'string' and type(seed) == 'number' and type(biomes) == 'table') then
|
||||
return
|
||||
end
|
||||
|
||||
local param = {
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue