mapgen.lua 27.5 KB
Newer Older
1
-- clear default mapgen biomes, decorations and ores
2
3
minetest.clear_registered_biomes()
minetest.clear_registered_decorations()
4
--minetest.clear_registered_ores()
tenplus1's avatar
tenplus1 committed
5

6
local path = minetest.get_modpath("ethereal")
7

8
dofile(path .. "/ores.lua")
9

10
11
12
path = path .. "/schematics/"

local dpath = minetest.get_modpath("default") .. "/schematics/"
13

TenPlus1's avatar
TenPlus1 committed
14
-- tree schematics
15
16
17
18
19
20
dofile(path .. "orange_tree.lua")
dofile(path .. "banana_tree.lua")
dofile(path .. "bamboo_tree.lua")
dofile(path .. "birch_tree.lua")
dofile(path .. "bush.lua")
dofile(path .. "waterlily.lua")
21

TenPlus1's avatar
TenPlus1 committed
22
--= Biomes (Minetest 0.4.13 and above)
23

TenPlus1's avatar
TenPlus1 committed
24
local add_biome = function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
25

TenPlus1's avatar
TenPlus1 committed
26
	if p ~= 1 then return end
27

TenPlus1's avatar
TenPlus1 committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	minetest.register_biome({
		name = a,
		node_dust = b,
		node_top = c,
		depth_top = d,
		node_filler = e,
		depth_filler = f,
		node_stone = g,
		node_water_top = h,
		depth_water_top = i,
		node_water = j,
		node_river_water = k,
		y_min = l,
		y_max = m,
		heat_point = n,
		humidity_point = o,
	})
45
46
end

TenPlus1's avatar
TenPlus1 committed
47
48
add_biome("underground", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
	-31000, -192, 50, 50, 1)
TenPlus1's avatar
TenPlus1 committed
49

Milan's avatar
Milan committed
50
add_biome("mountain", "default:snowblock", "default:snow", 1, "default:snowblock", 2,
51
	"default:stone", "default:ice", nil, nil, nil, 311, 31000, 0, 50, 1)
52

TenPlus1's avatar
TenPlus1 committed
53
add_biome("desert", nil, "default:desert_sand", 1, "default:desert_sand", 3,
54
	"default:desert_stone", nil, nil, nil, nil, 4, 23, 95, 5, ethereal.desert)
55

TenPlus1's avatar
TenPlus1 committed
56
add_biome("desert_ocean", nil, "default:sand", 1, "default:sand", 2,
57
58
59
60
61
62
63
64
65
66
67
	"default:desert_stone", nil, nil, nil, nil, -192, 3, 95, 5, ethereal.desert)

add_biome("sandstone", nil, "default:sandstone", 1, "default:sandstone", 1,
	"default:sandstone", nil, nil, nil, nil, 7, 78, 75, 2, ethereal.sandstone)

add_biome("sandstone_ocean", nil, "default:sand", 1, "default:sand", 2,
	nil, nil, nil, nil, nil, -192, 6, 75, 2, ethereal.sandstone)

add_biome("savannah", nil, "default:dirt_with_dry_grass", 1, "default:dirt", 3,
	nil, nil, nil, nil, nil, 2, 67, 84, 24, ethereal.savannah)

Milan's avatar
Milan committed
68
add_biome("savannah_ocean", nil, "default:sand", 1, "default:sandstone", 2,
69
70
71
72
73
74
75
76
	nil, nil, nil, nil, nil, -192, 1, 84, 24, ethereal.savannah)

add_biome("fiery", nil, "ethereal:fiery_dirt", 1, "default:dirt", 3,
	nil, nil, nil, nil, nil, 5, 50, 100, 0, ethereal.fiery)

add_biome("fiery_ocean", nil, "default:sand", 1, "default:sand", 2,
	nil, nil, nil, nil, nil, -192, 4, 100, 0, ethereal.fiery)

Milan's avatar
Milan committed
77
add_biome("caves_dunes", "default:desert_sand", "default:sandstone", 6, "air", 8,
78
79
	nil, nil, nil, nil, nil, 32, 120, 10, 2, ethereal.caves)

Milan's avatar
Milan committed
80
81
add_biome("caves", nil, "default:desert_stone", 4, "air", 8,
	nil, nil, nil, nil, nil, 4, 31, 10, 2, ethereal.caves)
82
83
84

add_biome("caves_ocean", "default:gravel", "default:sand", 3, "air", 8,
	nil, nil, nil, nil, nil, -14, 3, 10, 2, ethereal.caves)
85

86
87
88
89
90
add_biome("caves_coldtop", nil, "ethereal:cold_dirt", 1, "air", 6,
	nil, nil, nil, nil, nil, 120, 310, 10, 2, ethereal.caves)

add_biome("caves_snowtop", "default:snowblock", "default:dirt", 3, "air", 8,
	"default:stone", nil, nil, nil, nil, 310, 31000, 10, 2, ethereal.caves)
Milan's avatar
Milan committed
91

TenPlus1's avatar
TenPlus1 committed
92
add_biome("glacier", "default:snowblock", "default:snowblock", 1,
93
	"default:snowblock", 3, "default:ice", "default:ice", 10, nil, "default:ice", 351, 31000, 0, 95, ethereal.glacier)
94

95
add_biome("glacier_ocean", "default:snowblock", "default:silver_sand", 1, "default:silver_sandstone", 3,
96
	"default:ice", "default:ice", 2, "default:ice", "default:gravel", 320, 350, 0, 95, ethereal.glacier)
97

98
add_biome("clearing", nil, "ethereal:green_dirt", 1, "default:dirt", 3,
99
	nil, nil, nil, nil, nil, 1, 85, 42, 65, 1)
100

101
add_biome("bacon", "bacon:cookedblock", "bacon:cookedblock", 1,
102
	"bacon:cookedblock", 3, "bacon:rawblock", "mobs:cheeseblock", 10, nil, nil, 1, 6, 45, 45, ethereal.glacier)
103
104

add_biome("candy", nil, "mtcandy:dotted_green", 1,
105
106
	"mtcandy:dotted_yellow", 3, "mtcandy:dotted_orange", "mtcandy:candyrec_bluecyan", 10, nil, nil, 4, 80, 45, 45, ethereal.glacier)
--[[
107
add_biome("candytwo", nil, "mtcandy:daisy", 1,
108

109
110
	"mtcandy:dotted_orange", 3, "mtcandy:dotted_yellow", "mtcandy:candyrec_bluecyan", 10, nil, nil, 16, 60, 0, 0, ethereal.glacier)

111

112
113
114
115
116
117
add_biome("candythree", nil, "mtcandy:dotted_green", 1,
	"mtcandy:dotted_pink", 3, "mtcandy:orange", nil, 5, nil, nil, 6, 32, 0, 0, ethereal.glacier)

add_biome("candythreehalf", nil, "mtcandy:dotted_green", 1,
	"mtcandy:dotted_pink", 3, "mtcandy:emenems", nil, 5, nil, nil, 16, 54, 0, 0, ethereal.glacier)

118

119
120
add_biome("candyfour", nil, "mtcandy:daisy", 1,
	"mtcandy:dotted_pink", 3, "mtcandy:milk_choco", nil, 10, nil, nil, 28, 42, 0, 0, ethereal.glacier)
121
]]
122

123
add_biome("stone_grassland", nil, "ethereal:green_dirt", 1, "default:stone", 3,
124
	nil, nil, nil, nil, nil, 1, 85, 35, 56, 1)
125
126

add_biome("sandstone_grassland", nil, "ethereal:green_dirt", 1, "default:sandstone", 3,
127
	nil, nil, nil, nil, nil, 1, 85, 36, 46, 1)
128

TenPlus1's avatar
TenPlus1 committed
129
add_biome("bamboo", nil, "ethereal:bamboo_dirt", 1, "default:dirt", 3,
130
	nil, nil, nil, nil, nil, 3, 120, 40, 65, ethereal.bamboo)
131

TenPlus1's avatar
TenPlus1 committed
132
add_biome("bamboo_ocean", nil, "default:sand", 1, "default:sand", 2,
133
	nil, nil, nil, nil, nil, -192, 2, 40, 65, ethereal.bamboo)
TenPlus1's avatar
TenPlus1 committed
134

Milan's avatar
Milan committed
135
add_biome("mesa", nil, "ethereal:mesa_dirt", 1, "bakedclay:orange", 15,
136
    nil, nil, nil, nil, nil, 3, 92, 28, 100, ethereal.mesa)
137

138
add_biome("mesa_ocean", nil, "default:gravel", 1, "default:gravel", 2,
139
    nil, nil, nil, nil, nil, -192, 2, 28, 100, ethereal.mesa)
140
141
142
143
144
145

add_biome("grassytwo", nil, "ethereal:green_dirt", 1, "default:dirt", 3,
	nil, nil, nil, nil, nil, 2, 124, 29, 98, ethereal.grassytwo)

add_biome("grassytwo_ocean", nil, "default:sand", 1, "default:sand", 2,
	nil, nil, nil, nil, nil, -192, 1, 29, 98, ethereal.grassytwo)
TenPlus1's avatar
TenPlus1 committed
146

TenPlus1's avatar
TenPlus1 committed
147
add_biome("alpine", nil, "default:dirt_with_snow", 1, "default:dirt", 2,
148
	nil, nil, 1, "default:ice", nil, 221, 310, 4, 65, ethereal.alpine)
149

TenPlus1's avatar
TenPlus1 committed
150
add_biome("snowy", nil, "ethereal:cold_dirt", 1, "default:dirt", 2,
151
	nil, nil, nil, nil, nil, 120, 220, 16, 35, ethereal.snowy)
TenPlus1's avatar
TenPlus1 committed
152

153
add_biome("frost", nil, "ethereal:crystal_dirt", 1, "default:dirt", 7,
154
	nil, "default:ice", 1, nil, "default:ice", 130, 185, 9, 42, ethereal.frost)
155

156
add_biome("frost_ocean", nil, "default:silver_sand", 1, "default:silver_sand", 2,
157
	nil, nil, nil, nil, nil, 90, 129, 9, 42, ethereal.frost)
TenPlus1's avatar
TenPlus1 committed
158

TenPlus1's avatar
TenPlus1 committed
159
add_biome("grassy", nil, "ethereal:green_dirt", 1, "default:dirt", 3,
160
	nil, nil, nil, nil, nil, 6, 119, 50, 40, ethereal.grassy)
161
162
163

add_biome("grassy_dunes", nil, "defaut:sand", 1, "defaut:gravel", 3,
	nil, nil, nil, nil, nil, 5, 5, 50, 40, ethereal.grassy)
164

TenPlus1's avatar
TenPlus1 committed
165
add_biome("grassy_ocean", nil, "defaut:sand", 2, "default:gravel", 1,
166
	nil, nil, nil, nil, nil, -310, 4, 50, 40, ethereal.grassy)
167

TenPlus1's avatar
TenPlus1 committed
168
add_biome("grayness", nil, "ethereal:gray_dirt", 1, "default:dirt", 3,
169
	nil, nil, nil, nil, nil, 1, 4, 85, 92, ethereal.grayness)
170

171
add_biome("grayness_ocean", nil, "default:silver_sand", 1, "default:silver_sandstone", 2,
172
	nil, nil, nil, nil, nil, -192, 0, 60, 72, ethereal.grayness)
TenPlus1's avatar
TenPlus1 committed
173

174
add_biome("graynesstwo", nil, "ethereal:gray_dirt", 1, "default:dirt", 3,
175
    nil, nil, nil, nil, nil, 2, 4, 42, 60, ethereal.grayness)
TenPlus1's avatar
TenPlus1 committed
176

TenPlus1's avatar
TenPlus1 committed
177
add_biome("prairie", nil, "ethereal:prairie_dirt", 1, "default:dirt", 3,
178
	nil, nil, nil, nil, nil, 3, 26, 25, 40, ethereal.prairie)
179

TenPlus1's avatar
TenPlus1 committed
180
add_biome("prairie_ocean", nil, "default:sand", 1, "default:sand", 2,
181
	nil, nil, nil, nil, nil, -192, 2, 25, 40, ethereal.prairie)
TenPlus1's avatar
TenPlus1 committed
182
183

add_biome("jumble", nil, "ethereal:green_dirt", 1, "default:dirt", 3,
184
	nil, nil, nil, nil, nil, 2, 71, 25, 50, ethereal.jumble)
TenPlus1's avatar
TenPlus1 committed
185
186
187
188

add_biome("jumble_ocean", nil, "default:sand", 1, "default:sand", 2,
	nil, nil, nil, nil, nil, -192, 1, 25, 50, ethereal.jumble)

189
add_biome("junglee", nil, "ethereal:jungle_dirt", 1, "default:dirt", 6,
190
	nil, nil, nil, nil, nil, 3, 71, 85, 82, ethereal.junglee)
TenPlus1's avatar
TenPlus1 committed
191

192
add_biome("junglee_ocean", nil, "default:gravel", 3, "default:clay", 4,
193
	nil, nil, nil, nil, nil, -192, 2, 85, 82, ethereal.junglee)
TenPlus1's avatar
TenPlus1 committed
194
195
196
197
198
199
200

add_biome("grove", nil, "ethereal:grove_dirt", 1, "default:dirt", 3,
	nil, nil, nil, nil, nil, 3, 23, 45, 35, ethereal.grove)

add_biome("grove_ocean", nil, "default:sand", 1, "default:sand", 2,
	nil, nil, nil, nil, nil, -192, 2, 45, 35, ethereal.grove)

201
add_biome("mushroom", nil, "ethereal:mushroom_dirt", 1, "default:dirt", 8,
202
	nil, nil, nil, nil, nil, 3, 14, 45, 55, ethereal.mushroom)
TenPlus1's avatar
TenPlus1 committed
203

204
205
add_biome("mushroom_ocean", nil, "default:silver_sand", 1, "default:silver_sand", 8,
	nil, nil, nil, nil, nil, -192, 2, 45, 55, ethereal.mushroom)
TenPlus1's avatar
TenPlus1 committed
206
207
208
209
210

add_biome("quicksand", nil, "ethereal:quicksand2", 3, "default:gravel", 1,
	nil, nil, nil, nil, nil, 1, 1, 50, 38, ethereal.quicksand)

add_biome("plains", nil, "ethereal:dry_dirt", 1, "default:dirt", 3,
211
	nil, nil, nil, nil, nil, 3, 86, 35, 32, ethereal.plains)
TenPlus1's avatar
TenPlus1 committed
212
213

add_biome("plains_ocean", nil, "default:sand", 1, "default:sand", 2,
214
	nil, nil, nil, nil, nil, -192, 2, 35, 32, ethereal.plains)
TenPlus1's avatar
TenPlus1 committed
215
216

add_biome("sandclay", nil, "default:sand", 3, "default:clay", 2,
217
	nil, nil, nil, nil, nil, 1, 2, 72, 86, ethereal.sandclay)
218

Milan's avatar
Milan committed
219
add_biome("swamp", nil, "ethereal:swamp_dirt", 1, "default:dirt", 3,
220
	nil, nil, nil, nil, nil, 2, 7, 80, 95, ethereal.swamp)
221
222

add_biome("swamp_ocean", nil, "default:sand", 2, "default:clay", 2,
223
	nil, nil, nil, nil, nil, -192, 1, 80, 95, ethereal.swamp)
224

tenplus1's avatar
tenplus1 committed
225
226
--= schematic decorations

227
228
229
230
231
232
233
234
235
236
237
238
239
local add_schem = function(a, b, c, d, e, f, g)

	if g ~= 1 then return end

	minetest.register_decoration({
		deco_type = "schematic",
		place_on = a,
		sidelen = 80,
		fill_ratio = b,
		biomes = c,
		y_min = d,
		y_max = e,
		schematic = f,
240
        rotation = "random",
241
242
243
244
		flags = "place_center_x, place_center_z",
	})
end

tenplus1's avatar
tenplus1 committed
245
-- redwood tree
Milan's avatar
Milan committed
246
247
248
249
minetest.register_decoration({
    deco_type = "schematic",
    place_on = {"ethereal:mesa_dirt"},
    sidelen = 80,
250
    fill_ratio = 0.0035,
Milan's avatar
Milan committed
251
252
    biomes = mesa,
    rotation = "random",
253
    y_min = 6,
Milan's avatar
Milan committed
254
255
    y_max = 100,
    schematic = path .. "redwood_tree.mts",
256
    flags = "place_center_y, place_center_x, place_center_z",
Milan's avatar
Milan committed
257
})
258

tenplus1's avatar
tenplus1 committed
259
-- banana tree
260
add_schem({"ethereal:grove_dirt"}, 0.015, {"grove"}, 1, 100, ethereal.bananatree, ethereal.grove)
261

tenplus1's avatar
tenplus1 committed
262
-- healing tree
263
add_schem({"default:dirt_with_snow"}, 0.001, {"alpine"}, 221, 310, path .. "yellowtree.mts", ethereal.alpine)
264

tenplus1's avatar
tenplus1 committed
265
-- crystal frost tree
266
add_schem({"ethereal:crystal_dirt"}, 0.01, {"frost"}, 130, 185, path .. "frosttrees.mts", ethereal.frost)
267

tenplus1's avatar
tenplus1 committed
268
-- giant mushroom
Milan's avatar
Milan committed
269
270
271
272
273
274
275
276
277
278
279
280
minetest.register_decoration({
    deco_type = "schematic",
    place_on = {"ethereal:mushroom_dirt"},
    sidelen = 85,
    fill_ratio = 0.012,
    biomes = "mushroom",
    rotation = "random",
    y_min = 2,
    y_max = 100,
    schematic = path .. "mushroomone.mts",
    flags = "place_center_y, place_center_x, place_center_z",
})
281

tenplus1's avatar
tenplus1 committed
282
-- small lava crater
283
--add_schem({"ethereal:fiery_dirt"}, 0.01, {"fiery"}, 30, 100, path .. "volcanom.mts", ethereal.fiery)
284

tenplus1's avatar
tenplus1 committed
285
-- large lava crater
286
--add_schem({"ethereal:fiery_dirt"}, 0.01, {"fiery"}, 1, 100, path .. "volcanol.mts", ethereal.fiery)
287

288
-- default jungle tree
Milan's avatar
Milan committed
289
add_schem({"ethereal:jungle_dirt"}, 0.032, {"junglee"}, 1, 100, dpath .. "jungle_tree.mts", ethereal.junglee)
290

tenplus1's avatar
tenplus1 committed
291
-- willow tree
292
add_schem({"ethereal:gray_dirt"}, 0.02, {"grayness","graynesstwo"}, 1, 100, path .. "willow.mts", ethereal.grayness)
293

294
-- pine tree (default for lower elevation and ethereal for higher)
295
296
297
add_schem({"ethereal:cold_dirt"}, 0.025, {"snowy","snowyfiller"}, 10, 220, dpath .. "pine_tree.mts", ethereal.snowy)
add_schem({"default:dirt_with_snow"}, 0.025, {"alpine"}, 221, 260, path .. "pinetree.mts", ethereal.alpine)
add_schem({"default:dirt_with_snow"}, 0.015, {"alpine"}, 221, 310, dpath .. "pine_tree.mts", ethereal.alpine)
298

299
300
-- default apple tree
add_schem({"ethereal:green_dirt"}, 0.02, {"jumble"}, 1, 100, dpath .. "apple_tree.mts", ethereal.grassy)
301
add_schem({"ethereal:green_dirt"}, 0.03, {"grassy"}, 1, 180, dpath .. "apple_tree.mts", ethereal.grassy)
302
add_schem({"ethereal:cold_dirt"}, 0.002, {"caves_coldtop"}, 160, 210, dpath .. "apple_tree.mts", ethereal.grassy)
303

304
-- big old tree
305
306
307
add_schem({"ethereal:green_dirt"}, 0.001, {"jumble"}, 1, 100, path .. "bigtree.mts", ethereal.jumble)

-- aspen tree
TenPlus1's avatar
tidy    
TenPlus1 committed
308
add_schem({"ethereal:green_dirt"}, 0.02, {"grassytwo"}, 1, 50, dpath .. "aspen_tree.mts", ethereal.jumble)
309

310
-- birch tree
311
add_schem({"ethereal:green_dirt"}, 0.02, {"grassytwo"}, 50, 100, ethereal.birchtree, ethereal.grassytwo)
312

tenplus1's avatar
tenplus1 committed
313
-- orange tree
314
add_schem({"ethereal:prairie_dirt"}, 0.01, {"prairie"}, 1, 100, ethereal.orangetree, ethereal.prairie)
315

316
317
-- default acacia tree
add_schem({"default:dirt_with_dry_grass"}, 0.004, {"savannah"}, 1, 100, dpath .. "acacia_tree.mts", ethereal.savannah)
318

319
-- large cactus (by Paramat)
320
if ethereal.desert == 1 then
321
322
323
324
minetest.register_decoration({
	deco_type = "schematic",
	place_on = {"default:desert_sand"},
	sidelen = 80,
325
326
327
328
329
330
331
332
	noise_params = {
		offset = -0.0005,
		scale = 0.0015,
		spread = {x = 200, y = 200, z = 200},
		seed = 230,
		octaves = 3,
		persist = 0.6
	},
333
	biomes = {"desert"},
334
335
	y_min = 5,
	y_max = 31000,
336
	schematic = dpath.."large_cactus.mts",
337
338
	flags = "place_center_x", --, place_center_z",
	rotation = "random",
339
})
340
end
341

342
-- palm tree
343
344
345
346
347
348
349
350
351
add_schem({"default:sand"}, 0.0025, {"desert_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.desert)
add_schem({"default:sand"}, 0.0025, {"plains_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.plains)
add_schem({"default:sand"}, 0.0025, {"sandclay"}, 1, 1, path .. "palmtree.mts", ethereal.sandclay)
add_schem({"default:sand"}, 0.0025, {"sandstone_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.sandstone)
add_schem({"default:sand"}, 0.0025, {"mesa_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.mesa)
add_schem({"default:sand"}, 0.0025, {"grove_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.grove)
add_schem({"default:sand"}, 0.0025, {"grassy_ocean"}, 1, 1, path .. "palmtree.mts", ethereal.grassy)

-- bamboo tree
352
add_schem({"ethereal:bamboo_dirt"}, 0.025, {"bamboo"}, 1, 120, ethereal.bambootree, ethereal.bamboo)
353
354

-- bush
355
add_schem({"ethereal:bamboo_dirt"}, 0.08, {"bamboo"}, 1, 120, ethereal.bush, ethereal.bamboo)
356

357
-- vine tree
Milan's avatar
Milan committed
358
add_schem({"ethereal:swamp_dirt"}, 0.02, {"swamp"}, 1, 100, path .. "vinetree.mts", ethereal.swamp)
359

tenplus1's avatar
tenplus1 committed
360
--= simple decorations
361
local add_node = function(a, b, c, d, e, f, g, h, i, j)
362

363

364
	if j ~= 1 then return end
365

366
367
368
369
370
371
372
373
374
375
376
377
	minetest.register_decoration({
		deco_type = "simple",
		place_on = a,
		sidelen = 80,
		fill_ratio = b,
		biomes = c,
		y_min = d,
		y_max = e,
		decoration = f,
		height_max = g,
		spawn_by = h,
		num_spawn_by = i,
378
        rotation = "random",
379
380
	})
end
381

Milan's avatar
Milan committed
382
383
384
-- bakedclay flowers
add_node({"ethereal:mesa_dirt"}, 0.035, {"mesa"}, 1, 100, {"bakedclay:delphinium", "bakedclay:thistle", "bakedclay:lazarus", "bakedclay:mannagrass"}, nil, nil, nil, ethereal.mesa)

385
386
-- scorched tree
add_node({"ethereal:dry_dirt"}, 0.006, {"plains"}, 1, 100, {"ethereal:scorched_tree"}, 6, nil, nil, ethereal.plains)
387

tenplus1's avatar
tenplus1 committed
388
-- dry shrub
389
390
add_node({"ethereal:dry_dirt"}, 0.015, {"plains"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.plains)
add_node({"default:sand"}, 0.015, {"grassy_ocean"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.grassy)
391
add_node({"default:desert_sand","default:desert_stone"}, 0.015, {"caves"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.desert)
392
393
add_node({"default:sandstone"}, 0.015, {"sandstone"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.sandstone)
add_node({"bakedclay:red", "bakedclay:orange"}, 0.015, {"mesa"}, 1, 100, {"default:dry_shrub"}, nil, nil, nil, ethereal.mesa)
394

395
-- Dornbush
396
add_node({"default:sand", "default:desert_sand", "default:dirt_with_dry_grass"}, 0.002, {"desert_ocean", "desert", "mesa_ocean", "mesa", "prairie_ocean", "prairie", "sandstone_ocean", "sandstone", "savannah_ocean", "savannah", "fiery_ocean"}, 5, 120, {"ethereal:dornbush"}, nil, nil, nil, ethereal.desert)
397

398
-- dry grass
399
400
add_node({"default:dirt_with_dry_grass"}, 0.25, {"savannah"}, 1, 100, {"default:dry_grass_2",
	"default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"}, nil, nil, nil, ethereal.savannah)
401

tenplus1's avatar
tenplus1 committed
402
-- flowers & strawberry
403
404
405
406
407
408
add_node({"ethereal:green_dirt"}, 0.025, {"grassy"}, 1, 100, {"flowers:dandelion_white",
	"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
	"flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.025, {"grassytwo"}, 1, 100, {"flowers:dandelion_white",
	"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
	"flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.grassytwo)
409

tenplus1's avatar
tenplus1 committed
410
-- prairie flowers & strawberry
411
412
413
add_node({"ethereal:prairie_dirt"}, 0.035, {"prairie"}, 1, 100, {"flowers:dandelion_white",
	"flowers:dandelion_yellow", "flowers:geranium", "flowers:rose", "flowers:tulip",
	"flowers:viola", "ethereal:strawberry_7"}, nil, nil, nil, ethereal.prairie)
414

tenplus1's avatar
tenplus1 committed
415
-- crystal spike & crystal grass
416
add_node({"ethereal:crystal_dirt"}, 0.02, {"frost"}, 130, 185, {"ethereal:crystal_spike",
417
	"ethereal:crystalgrass"}, nil, nil, nil, ethereal.frost)
418

tenplus1's avatar
tenplus1 committed
419
-- red shrub
420
add_node({"ethereal:fiery_dirt"}, 0.10, {"fiery"}, 1, 100, {"ethereal:dry_shrub"}, nil, nil, nil, ethereal.fiery)
TenPlus1's avatar
TenPlus1 committed
421
422

-- fire flower
TenPlus1's avatar
TenPlus1 committed
423
--add_node({"ethereal:fiery_dirt"}, 0.02, {"fiery"}, 1, 100, {"ethereal:fire_flower"}, nil, nil, nil, ethereal.fiery)
424

tenplus1's avatar
tenplus1 committed
425
-- snowy grass
426
add_node({"ethereal:gray_dirt"}, 0.5, {"grayness"}, 1, 100, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.grayness)
427
add_node({"ethereal:cold_dirt"}, 0.5, {"snowy"}, 1, 220, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.snowy)
428
add_node({"default:dirt_with_snow"}, 0.5, {"alpine"}, 221, 310, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.alpine)
429
add_node({"ethereal:cold_dirt"}, 0.2, {"caves_coldtop"}, 266, 310, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.alpine)
430
add_node({"ethereal:crystalgrass"}, 0.5, {"frost"}, 130, 185, {"ethereal:snowygrass"}, nil, nil, nil, ethereal.frost)
431

tenplus1's avatar
tenplus1 committed
432
-- cactus
433
434
add_node({"default:sandstone"}, 0.0025, {"sandstone"}, 1, 100, {"default:cactus"}, 3, nil, nil, ethereal.sandstone)
add_node({"default:desert_sand"}, 0.005, {"desert"}, 1, 100, {"default:cactus"}, 4, nil, nil, ethereal.desert)
435

436
437
-- wild red mushroom
add_node({"ethereal:mushroom_dirt"}, 0.01, {"mushroom"}, 1, 100, {"flowers:mushroom_fertile_red"}, nil, nil, nil, ethereal.mushroom)
438

439
440
441
442
443
local list = {
	{"junglee", "ethereal:jungle_dirt", ethereal.junglee},
	{"grassy", "ethereal:green_dirt", ethereal.grassy},
	{"grassytwo", "ethereal:green_dirt", ethereal.grassytwo},
	{"prairie", "ethereal:prairie_dirt", ethereal.prairie},
444
	{"mushroom", "ethereal:mushroom_dirt", ethereal.mushroom},
Milan's avatar
Milan committed
445
	{"swamp", "ethereal:swamp_dirt", ethereal.swamp},
446
447
448
}

-- wild red and brown mushrooms
449
for _, row in pairs(list) do
450

451
if row[3] == 1 then
452
453
minetest.register_decoration({
	deco_type = "simple",
454
	place_on = {row[2]},
455
456
457
458
459
460
461
462
463
	sidelen = 16,
	noise_params = {
		offset = 0,
		scale = 0.009,
		spread = {x = 200, y = 200, z = 200},
		seed = 2,
		octaves = 3,
		persist = 0.66
	},
464
	biomes = {row[1]},
465
466
	y_min = 1,
	y_max = 120,
467
	decoration = {"flowers:mushroom_brown", "flowers:mushroom_red"},
468
})
469
470
471
end

end
472

tenplus1's avatar
tenplus1 committed
473
-- jungle grass
474
add_node({"ethereal:jungle_dirt"}, 0.10, {"junglee"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.junglee)
475
add_node({"ethereal:green_dirt"}, 0.15, {"jumble"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.jumble)
Milan's avatar
Milan committed
476
add_node({"ethereal:mesa_dirt"}, 0.10, {"mesa"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.mesa)
477
add_node({"ethereal:green_dirt"}, 0.25, {"swamp"}, 1, 100, {"default:junglegrass"}, nil, nil, nil, ethereal.swamp)
478

tenplus1's avatar
tenplus1 committed
479
-- grass
480
481
add_node({"ethereal:cold_dirt"}, 0.2, {"caves_coldtop"}, 180, 265, {"default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.alpine)
add_node({"ethereal:cold_dirt"}, 0.1, {"caves_coldtop"}, 123, 179, {"default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.alpine)
482
483
484
add_node({"ethereal:green_dirt"}, 0.95, {"grassy"}, 1, 120, {"default:grass_5"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.95, {"grassytwo","clearing"}, 1, 140, {"default:grass_5"}, nil, nil, nil, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.95, {"jumble"}, 1, 120, {"default:grass_2", "default:grass_3",
485
	"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.jumble)
486
add_node({"ethereal:jungle_dirt"}, 0.15, {"junglee"}, 1, 120, {"default:grass_2", "default:grass_3",
487
	"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.junglee)
488
add_node({"ethereal:prairie_dirt"}, 0.35, {"prairie"}, 1, 115, {"default:grass_2", "default:grass_3",
489
	"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.prairie)
490
add_node({"ethereal:grove_dirt"}, 0.65, {"grove"}, 1, 115, {"default:grass_2", "default:grass_3",
491
	"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.grove)
492
add_node({"ethereal:bamboo_dirt"}, 0.35, {"bamboo"}, 1, 120, {"default:grass_2", "default:grass_3",
493
	"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
494
495
add_node({"ethereal:green_dirt"}, 1, {"stone_grassland"}, 1, 120, { "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
add_node({"ethereal:green_dirt"}, 1, {"sandstone_grassland"}, 1, 120, {"default:grass_4", "default:grass_5"}, nil, nil, nil, ethereal.bamboo)
496
add_node({"ethereal:green_dirt"}, 0.35, {"swamp"}, 1, 100, {"default:grass_3",
497
	"default:grass_4"}, nil, nil, nil, 1)
498
499

-- grass on sand
500
add_node({"default:sand"}, 0.25, {"sandclay"}, 3, 4, {"default:grass_2", "default:grass_3"}, nil, nil, nil, ethereal.sandclay)
501

tenplus1's avatar
tenplus1 committed
502
-- ferns
Milan's avatar
Milan committed
503
add_node({"ethereal:grove_dirt","ethereal:jungle_dirt","ethereal:mesa_dirt"}, 0.2, {"grove","junglee","mesa"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.grove)
Milan's avatar
Milan committed
504
add_node({"ethereal:swamp_dirt"}, 0.1, {"swamp"}, 1, 100, {"ethereal:fern"}, nil, nil, nil, ethereal.swamp)
505

tenplus1's avatar
tenplus1 committed
506
-- snow
507
508
add_node({"ethereal:cold_dirt"}, 0.6, {"snowy","snowyfiller"}, 4, 220, {"default:snow"}, nil, nil, nil, ethereal.snowy)
add_node({"default:dirt_with_snow"}, 0.8, {"alpine"}, 221, 310, {"default:snow"}, nil, nil, nil, ethereal.alpine)
Milan's avatar
Milan committed
509
510
511
512
add_node({"ethereal:green_dirt"}, 0.8, {"clearing","grassytwo"}, 86, 140, {"default:snow"}, nil, nil, nil, ethereal.alpine)
add_node({"ethereal:green_dirt"}, 0.4, {"clearing","grassytwo"}, 76, 86, {"default:snow"}, nil, nil, nil, ethereal.alpine)
add_node({"ethereal:green_dirt"}, 0.1, {"clearing","grassytwo"}, 72, 76, {"default:snow"}, nil, nil, nil, ethereal.alpine)
add_node({"ethereal:green_dirt"}, 0.04, {"clearing","grassytwo"}, 68, 72, {"default:snow"}, nil, nil, nil, ethereal.alpine)
513

tenplus1's avatar
tenplus1 committed
514
-- wild onion
515
516
517
518
add_node({"ethereal:green_dirt"}, 0.25, {"grassy"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.25, {"grassytwo"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.25, {"jumble"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.jumble)
add_node({"ethereal:prairie_dirt"}, 0.25, {"prairie"}, 1, 100, {"ethereal:onion_4"}, nil, nil, nil, ethereal.prairie)
519
add_node({"ethereal:cold_dirt"}, 0.15, {"caves_coldtop"}, 123, 180, {"ethereal:onion_4"}, nil, nil, nil, ethereal.prairie)
520

tenplus1's avatar
tenplus1 committed
521
-- papyrus
522
add_node({"ethereal:green_dirt"}, 0.1, {"grassy"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.grassy)
523
add_node({"ethereal:jungle_dirt"}, 0.1, {"junglee"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.junglee)
Milan's avatar
Milan committed
524
add_node({"ethereal:swamp_dirt"}, 0.1, {"swamp"}, 1, 1, {"default:papyrus"}, 4, "default:water_source", 1, ethereal.swamp)
525

tenplus1's avatar
tenplus1 committed
526
527
--= Farming Redo plants

528
if farming and farming.mod and farming.mod == "redo" then
529

530
print ("[MOD] Ethereal - Farming Redo detected and in use")
531

tenplus1's avatar
tenplus1 committed
532
-- potato
533
add_node({"ethereal:jungle_dirt"}, 0.035, {"junglee"}, 1, 100, {"farming:potato_3"}, nil, nil, nil, ethereal.junglee)
534

tenplus1's avatar
tenplus1 committed
535
-- carrot, cucumber, potato, tomato, corn, coffee, raspberry, rhubarb
536
add_node({"ethereal:green_dirt"}, 0.05, {"grassytwo", "stone_grassland", "sandstone_grassland"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
537
538
539
540
541
542
543
544
545
546
547
	"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
	"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.05, {"grassy"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
	"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
	"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.05, {"jumble"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
	"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
	"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.jumble)
add_node({"ethereal:prairie_dirt"}, 0.05, {"prairie"}, 1, 100, {"farming:carrot_7", "farming:cucumber_4",
	"farming:potato_3", "farming:tomato_7", "farming:corn_8", "farming:coffee_5",
	"farming:raspberry_4", "farming:rhubarb_3", "farming:blueberry_4"}, nil, nil, nil, ethereal.prairie)
548

tenplus1's avatar
tenplus1 committed
549
-- melon and pumpkin
550
551
552
553
add_node({"ethereal:jungle_dirt"}, 0.015, {"junglee"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.junglee)
add_node({"ethereal:green_dirt"}, 0.015, {"grassy"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassy)
add_node({"ethereal:green_dirt"}, 0.015, {"grassytwo"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.015, {"jumble"}, 1, 1, {"farming:melon_8", "farming:pumpkin_8"}, nil, "default:water_source", 1, ethereal.jumble)
554

555
-- green beans
556
add_node({"ethereal:green_dirt"}, 0.035, {"grassytwo"}, 1, 100, {"farming:beanbush"}, nil, nil, nil, ethereal.grassytwo)
557

558
-- grape bushel
559
560
561
add_node({"ethereal:green_dirt"}, 0.025, {"grassytwo"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassytwo)
add_node({"ethereal:green_dirt"}, 0.025, {"grassy"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.grassy)
add_node({"ethereal:prairie_dirt"}, 0.025, {"prairie"}, 1, 100, {"farming:grapebush"}, nil, nil, nil, ethereal.prairie)
562

563
564
end

565
-- place waterlily in beach areas
566
567
568
569
570
571
572
573
local list = {
	{"desert_ocean", ethereal.desert},
	{"plains_ocean", ethereal.plains},
	{"sandclay", ethereal.sandclay},
	{"sandstone_ocean", ethereal.sandstone},
	{"mesa_ocean", ethereal.mesa},
	{"grove_ocean", ethereal.grove},
	{"grassy_ocean", ethereal.grassy},
574
	{"swamp_ocean", ethereal.swamp},
575
576
}

577
for _, row in pairs(list) do
578

579
	if row[2] == 1 then
580

581
582
	minetest.register_decoration({
		deco_type = "schematic",
583
		place_on = {"default:sand"},
584
585
586
587
588
589
590
591
592
		sidelen = 16,
		noise_params = {
			offset = -0.12,
			scale = 0.3,
			spread = {x = 200, y = 200, z = 200},
			seed = 33,
			octaves = 3,
			persist = 0.7
		},
593
		biomes = {row[1]},
594
595
		y_min = 0,
		y_max = 0,
596
		schematic = ethereal.waterlily,
597
598
		rotation = "random",
	})
599

600
	end
601

602
end
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631

-- Generate Illumishroom in caves next to coal
minetest.register_on_generated(function(minp, maxp)

	if minp.y > -30 or maxp.y < -3000 then
		return
	end

	local bpos
	local coal = minetest.find_nodes_in_area_under_air(minp, maxp, "default:stone_with_coal")

	for n = 1, #coal do

		bpos = {x = coal[n].x, y = coal[n].y + 1, z = coal[n].z }

		if math.random(1, 2) == 1 then

			if bpos.y > -3000 and bpos.y < -2000 then
				minetest.swap_node(bpos, {name = "ethereal:illumishroom3"})

			elseif bpos.y > -2000 and bpos.y < -1000 then
				minetest.swap_node(bpos, {name = "ethereal:illumishroom2"})

			elseif bpos.y > -1000 and bpos.y < -30 then
				minetest.swap_node(bpos, {name = "ethereal:illumishroom"})
			end
		end
	end
end)