diff --git a/depends.txt b/depends.txt index 9d0cab1..08c1a83 100644 --- a/depends.txt +++ b/depends.txt @@ -1,3 +1,4 @@ default flowers? moreblocks? +skins? diff --git a/src/mapgen.lua b/src/mapgen.lua index 741416e..5d9fce8 100644 --- a/src/mapgen.lua +++ b/src/mapgen.lua @@ -58,19 +58,18 @@ end) --Identify the mapgen. -minetest.register_on_mapgen_init(function(MapgenParams) - local mgname = MapgenParams.mgname - if not mgname then - io.write("[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!\n") - end - if mgname == "v7" then - --Load mapgen_v7 compatibility. - dofile(minetest.get_modpath("snow").."/src/mapgen_v7.lua") - else - --Load mapgen_v6 compatibility. - dofile(minetest.get_modpath("snow").."/src/mapgen_v6.lua") - end -end) +local mgname = minetest.get_mapgen_setting"mg_name" +if not mgname then + minetest.log("error", "[MOD] Snow Biomes: WARNING! mapgen could not be identifyed!") +end +local path = minetest.get_modpath"snow" +if mgname == "v7" then + --Load mapgen_v7 compatibility. + dofile(path.."/src/mapgen_v7.lua") +else + --Load mapgen_v6 compatibility. + dofile(path.."/src/mapgen_v6.lua") +end -- To complete the commenting-out add the *closing* comment under this line. diff --git a/src/nodes.lua b/src/nodes.lua index bc8e849..210f9a0 100644 --- a/src/nodes.lua +++ b/src/nodes.lua @@ -60,13 +60,10 @@ end) - --Christmas easter egg - minetest.register_on_mapgen_init( function() - if rawget(_G, "skins") then - skins.add("character_snow_man") - end + -- Christmas egg + if minetest.global_exists"skins" then + skins.add"character_snow_man" end - ) -- Decorated Pine Leaves