forked from vlapsley/australia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiome_mangroves.lua
executable file
·161 lines (142 loc) · 3.65 KB
/
biome_mangroves.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
-- mods/australia/biome_mangroves.lua
minetest.register_biome({
name = "mangroves",
--node_dust = "",
node_top = "australia:mangrove_mud",
depth_top = 3,
node_filler = "default:clay",
depth_filler = 1,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
node_river_water = "australia:muddy_river_water_source",
y_min = -2,
y_max = 3,
heat_point = 80,
humidity_point = 80,
})
--
-- Register ores
--
-- All mapgens except singlenode
-- Blob ore first to avoid other ores inside blobs
--
-- Decorations
--
-- Mangrove Fern
minetest.register_decoration({
deco_type = "simple",
place_on = {"australia:mangrove_mud",
"default:dirt",
"default:dirt_with_grass"},
sidelen = 80,
fill_ratio = 0.2,
biomes = {"mangroves"},
y_min = 2,
y_max = 3,
decoration = "australia:mangrove_fern",
})
-- Mangrove Lily
minetest.register_decoration({
deco_type = "simple",
place_on = {"australia:mangrove_mud",
"default:dirt",
"default:dirt_with_grass"},
sidelen = 80,
fill_ratio = 0.1,
biomes = {"mangroves"},
y_min = 2,
y_max = 3,
decoration = "australia:mangrove_lily",
})
-- Mangrove Palm
minetest.register_decoration({
deco_type = "schematic",
place_on = {"australia:mangrove_mud",
"default:dirt"},
sidelen = 80,
fill_ratio = 0.3,
biomes = {"mangroves"},
y_min = 1,
y_max = 3,
schematic = {
size = { x = 1, y = 4, z = 1},
data = {
{ name = "ignore", param1 = 0, param2 = 0 },
{ name = "australia:mangrove_palm_trunk", param1 = 255, param2 = 0 },
{ name = "australia:mangrove_palm_leaf_bot", param1 = 255, param2 = 0 },
{ name = "australia:mangrove_palm_leaf_top", param1 = 255, param2 = 0 },
},
},
flags = "force_placement",
})
--
-- Trees
--
-- Grey Mangrove
aus.schematics.grey_mangrove_tree = {}
local max_ht = 6
local tree = "australia:grey_mangrove_tree"
local leaves = "australia:grey_mangrove_leaves"
for h = 4,max_ht do
local schem = aus.generate_mangrove_tree_schematic(3, tree, leaves)
push(aus.schematics.grey_mangrove_tree, schem)
minetest.register_decoration({
deco_type = "schematic",
sidelen = 80,
place_on = {"australia:mangrove_mud", "default:dirt", "default:sand"},
fill_ratio = 0.003,
biomes = {"mangroves"},
y_min = -2,
y_max = 3,
schematic = schem,
flags = "place_center_x, place_center_z",
rotation = "random",
})
end
-- Mangrove Apple
aus.schematics.mangrove_apple_tree = {}
local max_r = 5
local ht = 4
local fruit = "australia:mangrove_apple"
local limbs = false
local tree = "australia:mangrove_apple_tree"
local leaves = "australia:mangrove_apple_leaves"
for r = 3,max_r do
local schem = aus.generate_tree_schematic(1, {x=r, y=ht, z=r}, tree, leaves, fruit, limbs)
push(aus.schematics.mangrove_apple_tree, schem)
minetest.register_decoration({
deco_type = "schematic",
sidelen = 80,
place_on = {"australia:mangrove_mud", "default:dirt", "default:sand"},
y_min = 0,
y_max = 3,
fill_ratio = (max_r-r+1)/5000,
biomes = {"mangroves"},
schematic = schem,
flags = "place_center_x, place_center_z",
rotation = "random",
})
end
-- Stilted Mangrove
aus.schematics.stilted_mangrove_tree = {}
local max_ht = 6
local tree = "australia:stilted_mangrove_tree"
local leaves = "australia:stilted_mangrove_leaves"
for h = 4,max_ht do
local schem = aus.generate_mangrove_tree_schematic(3, tree, leaves)
push(aus.schematics.stilted_mangrove_tree, schem)
minetest.register_decoration({
deco_type = "schematic",
sidelen = 80,
place_on = {"australia:mangrove_mud", "default:dirt", "default:sand"},
fill_ratio = 0.003,
biomes = {"mangroves"},
y_min = -2,
y_max = 3,
schematic = schem,
flags = "place_center_x, place_center_z",
rotation = "random",
})
end