Fix ferns compatibility with minetest >= 0.4.16 (#78)

This commit is contained in:
sys4-fr 2018-03-17 21:37:02 +01:00 committed by Vanessa Dannenberg
parent 0af7b69afa
commit 9789d6da3a
6 changed files with 32 additions and 6 deletions

View File

@ -6,12 +6,17 @@ local S = plantlife_i18n.gettext
-- (by Mossmanikin)
-- License (everything): WTFPL
-----------------------------------------------------------------------------------------------
local fern1 = minetest.registered_items["default:fern_1"] or false
fern1 = (fern1 and fern1.name) or "ferns:fern_01"
minetest.register_craft({
type = "shapeless",
output = "ferns:fiddlehead 3",
recipe = {"ferns:fern_01"},
replacements = {
{"ferns:fern_01", "ferns:ferntuber"}
{fern1, "ferns:ferntuber"}
},
})

View File

@ -19,6 +19,14 @@ assert(abstract_ferns.config.enable_lady_fern == true)
local S = plantlife_i18n.gettext
-- Maintain backward compatibilty
-- minetest-0.5: Begin
local default_ferns = minetest.registered_items["default:fern_1"] or false
if default_ferns then
minetest.register_alias("ferns:fern_03", "default:fern_3")
minetest.register_alias("ferns:fern_02", "default:fern_2")
minetest.register_alias("ferns:fern_01", "default:fern_1")
end
-- minetest-0.5: End
minetest.register_alias("archaeplantae:fern", "ferns:fern_03")
minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02")
minetest.register_alias("archaeplantae:fern_small", "ferns:fern_01")
@ -67,7 +75,13 @@ end
-- Init
-----------------------------------------------------------------------------------------------
create_nodes()
if default_ferns then
for i = 1, 3 do
nodenames[i] = "ferns:fern_"..string.format("%02d", i)
end
else
create_nodes()
end
-----------------------------------------------------------------------------------------------
-- Spawning
@ -136,6 +150,7 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
"default:mossycobble",
"default:stone_with_coal",
"default:stone_with_iron",
"default:stone_with_tin", -- minetest >= 0.4.16
"moreores:mineral_tin",
"moreores:mineral_silver",
"sumpf:sumpf"
@ -149,6 +164,7 @@ if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a
--"default:stone_with_mese",
--"default:stone_with_gold",
--"default:stone_with_diamond",
"default:stone_with_tin", -- minetest >= 0.4.16
"moreores:mineral_tin",
"moreores:mineral_silver"
--"moreores:mineral_mithril"
@ -174,6 +190,7 @@ if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant
"default:mossycobble",
"default:stone_with_coal",
"default:stone_with_iron",
"default:stone_with_tin", -- minetest >= 0.4.16
"moreores:mineral_tin",
"moreores:mineral_silver",
"sumpf:sumpf"

View File

@ -297,6 +297,7 @@ if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
biome_lib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
"default:sand",
"default:desert_sand"--,
--"dryplants:grass_short"
@ -330,7 +331,7 @@ if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes = {"default:water_source", "default:river_water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,

View File

@ -82,6 +82,7 @@ if abstract_ferns.config.enable_horsetails_spawning == true then
spawn_chance = 400,
spawn_surfaces = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
"default:desert_sand",
"default:sand",
"dryplants:grass_short",
@ -91,7 +92,7 @@ if abstract_ferns.config.enable_horsetails_spawning == true then
},
seed_diff = 329,
min_elevation = 1, -- above sea level
near_nodes = {"default:water_source","default:gravel"},
near_nodes = {"default:water_source","default:river_water_source","default:gravel"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,
@ -107,6 +108,7 @@ if abstract_ferns.config.enable_horsetails_on_grass == true then
biome_lib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter", -- minetest >= 0.5
"sumpf:sumpf"
},
max_count = 35,

View File

@ -1,6 +1,6 @@
-----------------------------------------------------------------------------------------------
local title = "Ferns" -- former "Archae Plantae"
local version = "0.2.0"
local version = "0.2.1"
local mname = "ferns" -- former "archaeplantae"
-----------------------------------------------------------------------------------------------
-- (by Mossmanikin)

View File

@ -183,6 +183,7 @@ if abstract_ferns.config.enable_treeferns_in_jungle == true then
biome_lib:register_generate_plant({
surface = {
"default:dirt_with_grass",
"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
"default:sand",
"default:desert_sand",
},
@ -219,7 +220,7 @@ if abstract_ferns.config.enable_treeferns_in_oases == true then
neighbors = {"default:desert_sand"},
ncount = 1,
min_elevation = 1,
near_nodes = {"default:water_source"},
near_nodes = {"default:water_source","default:river_water_source"},
near_nodes_size = 2,
near_nodes_vertical = 1,
near_nodes_count = 1,