From c0557b2c231cbcc7837031544558283bab929bda Mon Sep 17 00:00:00 2001 From: Ezhh Date: Sun, 18 Mar 2018 00:25:16 +0000 Subject: [PATCH] Add names for register_decoration --- mods/default/mapgen.lua | 29 +++++++++++++++++++++++++++++ mods/fireflies/init.lua | 4 ++++ mods/flowers/mapgen.lua | 22 ++++++++++++++-------- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index f236f7b2..0ca7d02f 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -1534,6 +1534,7 @@ function default.register_mgv6_decorations() -- Papyrus minetest.register_decoration({ + name = "default:papyrus", deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1557,6 +1558,7 @@ function default.register_mgv6_decorations() -- Cacti minetest.register_decoration({ + name = "default:cactus", deco_type = "simple", place_on = {"default:desert_sand"}, sidelen = 16, @@ -1579,6 +1581,7 @@ function default.register_mgv6_decorations() for length = 1, 5 do minetest.register_decoration({ + name = "default:grass_"..length, deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1599,6 +1602,7 @@ function default.register_mgv6_decorations() -- Dry shrubs minetest.register_decoration({ + name = "default:dry_shrub", deco_type = "simple", place_on = {"default:desert_sand", "default:dirt_with_snow"}, sidelen = 16, @@ -1622,6 +1626,7 @@ end local function register_grass_decoration(offset, scale, length) minetest.register_decoration({ + name = "default:grass_" .. length, deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1642,6 +1647,7 @@ end local function register_dry_grass_decoration(offset, scale, length) minetest.register_decoration({ + name = "default:dry_grass_" .. length, deco_type = "simple", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, @@ -1662,6 +1668,7 @@ end local function register_fern_decoration(seed, length) minetest.register_decoration({ + name = "default:fern_" .. length, deco_type = "simple", place_on = {"default:dirt_with_coniferous_litter"}, sidelen = 16, @@ -1686,6 +1693,7 @@ function default.register_decorations() -- Apple tree and log minetest.register_decoration({ + name = "default:apple_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1706,6 +1714,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:apple_log", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1731,6 +1740,7 @@ function default.register_decorations() local chunksize = tonumber(minetest.get_mapgen_setting("chunksize")) if chunksize >= 5 then minetest.register_decoration({ + name = "default:emergent_jungle_tree", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 80, @@ -1756,6 +1766,7 @@ function default.register_decorations() -- Jungle tree and log minetest.register_decoration({ + name = "default:jungle_tree", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter", "default:dirt"}, sidelen = 80, @@ -1769,6 +1780,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:jungle_log", deco_type = "schematic", place_on = {"default:dirt_with_rainforest_litter", "default:dirt"}, sidelen = 80, @@ -1784,6 +1796,7 @@ function default.register_decorations() -- Taiga and temperate coniferous forest pine tree, small pine tree and log minetest.register_decoration({ + name = "default:pine_tree", deco_type = "schematic", place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"}, sidelen = 16, @@ -1803,6 +1816,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:small_pine_tree", deco_type = "schematic", place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"}, sidelen = 16, @@ -1822,6 +1836,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:pine_log", deco_type = "schematic", place_on = {"default:dirt_with_snow", "default:dirt_with_coniferous_litter"}, sidelen = 80, @@ -1837,6 +1852,7 @@ function default.register_decorations() -- Acacia tree and log minetest.register_decoration({ + name = "default:acacia_tree", deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, @@ -1857,6 +1873,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:acacia_log", deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, @@ -1879,6 +1896,7 @@ function default.register_decorations() -- Aspen tree and log minetest.register_decoration({ + name = "default:aspen_tree", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1898,6 +1916,7 @@ function default.register_decorations() }) minetest.register_decoration({ + name = "default:aspen_log", deco_type = "schematic", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -1920,6 +1939,7 @@ function default.register_decorations() -- Large cactus minetest.register_decoration({ + name = "default:large_cactus", deco_type = "schematic", place_on = {"default:desert_sand"}, sidelen = 16, @@ -1942,6 +1962,7 @@ function default.register_decorations() -- Cactus minetest.register_decoration({ + name = "default:cactus", deco_type = "simple", place_on = {"default:desert_sand"}, sidelen = 16, @@ -1964,6 +1985,7 @@ function default.register_decorations() -- Papyrus minetest.register_decoration({ + name = "default:papyrus", deco_type = "schematic", place_on = {"default:dirt"}, sidelen = 16, @@ -1984,6 +2006,7 @@ function default.register_decorations() -- Bush minetest.register_decoration({ + name = "default:bush", deco_type = "schematic", place_on = {"default:dirt_with_grass", "default:dirt_with_snow"}, sidelen = 16, @@ -2006,6 +2029,7 @@ function default.register_decorations() -- Acacia bush minetest.register_decoration({ + name = "default:acacia_bush", deco_type = "schematic", place_on = {"default:dirt_with_dry_grass"}, sidelen = 16, @@ -2049,6 +2073,7 @@ function default.register_decorations() -- Junglegrass minetest.register_decoration({ + name = "default:junglegrass", deco_type = "simple", place_on = {"default:dirt_with_rainforest_litter"}, sidelen = 80, @@ -2062,6 +2087,7 @@ function default.register_decorations() -- Dry shrub minetest.register_decoration({ + name = "default:dry_shrub", deco_type = "simple", place_on = {"default:desert_sand", "default:sand", "default:silver_sand"}, @@ -2084,6 +2110,7 @@ function default.register_decorations() -- Marram grass minetest.register_decoration({ + name = "default:marram_grass", deco_type = "simple", place_on = {"default:sand"}, sidelen = 4, @@ -2109,6 +2136,7 @@ function default.register_decorations() -- Coral reef minetest.register_decoration({ + name = "default:corals", deco_type = "schematic", place_on = {"default:sand"}, noise_params = { @@ -2134,6 +2162,7 @@ function default.register_decorations() -- Kelp minetest.register_decoration({ + name = "default:kelp", deco_type = "simple", place_on = {"default:sand"}, place_offset_y = -1, diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index 31647efb..104b5cdb 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -131,6 +131,7 @@ minetest.register_craft( { if minetest.get_mapgen_setting("mg_name") == "v6" then minetest.register_decoration({ + name = "fireflies:firefly_low", deco_type = "simple", place_on = "default:dirt_with_grass", place_offset_y = 2, @@ -142,6 +143,7 @@ if minetest.get_mapgen_setting("mg_name") == "v6" then }) minetest.register_decoration({ + name = "fireflies:firefly_high", deco_type = "simple", place_on = "default:dirt_with_grass", place_offset_y = 3, @@ -155,6 +157,7 @@ if minetest.get_mapgen_setting("mg_name") == "v6" then else minetest.register_decoration({ + name = "fireflies:firefly_low", deco_type = "simple", place_on = { "default:dirt_with_grass", @@ -177,6 +180,7 @@ else }) minetest.register_decoration({ + name = "fireflies:firefly_high", deco_type = "simple", place_on = { "default:dirt_with_grass", diff --git a/mods/flowers/mapgen.lua b/mods/flowers/mapgen.lua index 5e81925b..ad759c25 100644 --- a/mods/flowers/mapgen.lua +++ b/mods/flowers/mapgen.lua @@ -2,8 +2,9 @@ -- Mgv6 -- -local function register_mgv6_flower(name) +local function register_mgv6_flower(flower_name) minetest.register_decoration({ + name = "flowers:"..flower_name, deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -17,12 +18,13 @@ local function register_mgv6_flower(name) }, y_max = 30, y_min = 1, - decoration = "flowers:"..name, + decoration = "flowers:"..flower_name, }) end -local function register_mgv6_mushroom(name) +local function register_mgv6_mushroom(mushroom_name) minetest.register_decoration({ + name = "flowers:"..mushroom_name, deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -36,7 +38,7 @@ local function register_mgv6_mushroom(name) }, y_max = 30, y_min = 1, - decoration = "flowers:"..name, + decoration = "flowers:"..mushroom_name, spawn_by = "default:tree", num_spawn_by = 1, }) @@ -44,6 +46,7 @@ end local function register_mgv6_waterlily() minetest.register_decoration({ + name = "flowers:waterlily", deco_type = "simple", place_on = {"default:dirt"}, sidelen = 16, @@ -83,8 +86,9 @@ end -- All other biome API mapgens -- -local function register_flower(seed, name) +local function register_flower(seed, flower_name) minetest.register_decoration({ + name = "flowers:"..flower_name, deco_type = "simple", place_on = {"default:dirt_with_grass"}, sidelen = 16, @@ -99,12 +103,13 @@ local function register_flower(seed, name) biomes = {"grassland", "deciduous_forest", "floatland_grassland"}, y_max = 31000, y_min = 1, - decoration = "flowers:"..name, + decoration = "flowers:"..flower_name, }) end -local function register_mushroom(name) +local function register_mushroom(mushroom_name) minetest.register_decoration({ + name = "flowers:"..mushroom_name, deco_type = "simple", place_on = {"default:dirt_with_grass", "default:dirt_with_coniferous_litter"}, sidelen = 16, @@ -120,12 +125,13 @@ local function register_mushroom(name) "floatland_coniferous_forest"}, y_max = 31000, y_min = 1, - decoration = "flowers:"..name, + decoration = "flowers:"..mushroom_name, }) end local function register_waterlily() minetest.register_decoration({ + name = "default:waterlily", deco_type = "simple", place_on = {"default:dirt"}, sidelen = 16, -- 2.25.1