Skip to content

Commit

Permalink
Add names for register_decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezhh committed Mar 18, 2018
1 parent c2209c1 commit c0557b2
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
29 changes: 29 additions & 0 deletions mods/default/mapgen.lua
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -1964,6 +1985,7 @@ function default.register_decorations()
-- Papyrus

minetest.register_decoration({
name = "default:papyrus",
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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"},
Expand All @@ -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,
Expand All @@ -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 = {
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions mods/fireflies/init.lua
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
Expand All @@ -177,6 +180,7 @@ else
})

minetest.register_decoration({
name = "fireflies:firefly_high",
deco_type = "simple",
place_on = {
"default:dirt_with_grass",
Expand Down
22 changes: 14 additions & 8 deletions mods/flowers/mapgen.lua
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -36,14 +38,15 @@ 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,
})
end

local function register_mgv6_waterlily()
minetest.register_decoration({
name = "flowers:waterlily",
deco_type = "simple",
place_on = {"default:dirt"},
sidelen = 16,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit c0557b2

Please sign in to comment.