add 'vines_enable_roots' minetest.conf setting

This commit is contained in:
TenPlus1 2018-12-09 20:12:08 +00:00
parent 8c8300b450
commit e430a3125d
2 changed files with 16 additions and 4 deletions

View File

@ -50,3 +50,7 @@ table.
|average_length|int| The average length of vines| |average_length|int| The average length of vines|
For biome definitions please see the [plants_lib API documentation](https://github.com/VanessaE/plantlife_modpack/blob/master/API.txt) For biome definitions please see the [plants_lib API documentation](https://github.com/VanessaE/plantlife_modpack/blob/master/API.txt)
### minetest.conf settings
'vines_enable_roots' when not false defaults to {"default:dirt_with_grass", "default:dirt"}

View File

@ -3,6 +3,8 @@ vines = {
recipes = {} recipes = {}
} }
local enable_roots = minetest.settings:get_bool("vines_enable_roots")
-- support for i18n -- support for i18n
local S = plantlife_i18n.gettext local S = plantlife_i18n.gettext
@ -306,6 +308,15 @@ minetest.register_tool("vines:shears", {
-- VINES -- VINES
local spawn_root_surfaces = {}
if enable_roots ~= false then
spawn_root_surfaces = {
"default:dirt_with_grass",
"default:dirt"
}
end
vines.register_vine('root', vines.register_vine('root',
{description = S("Roots"), average_length = 9}, { {description = S("Roots"), average_length = 9}, {
choose_random_wall = true, choose_random_wall = true,
@ -313,10 +324,7 @@ vines.register_vine('root',
avoid_radius = 5, avoid_radius = 5,
spawn_delay = 500, spawn_delay = 500,
spawn_chance = 10, spawn_chance = 10,
spawn_surfaces = { spawn_surfaces = spawn_root_surfaces,
"default:dirt_with_grass",
"default:dirt"
},
spawn_on_bottom = true, spawn_on_bottom = true,
plantlife_limit = -0.6, plantlife_limit = -0.6,
humidity_min = 0.4, humidity_min = 0.4,