-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodes.lua
237 lines (195 loc) · 6.94 KB
/
nodes.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
--[[
Crater MG - Crater Map Generator for Minetest
(c) Pierre-Yves Rollo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]
local planet_name = "Planet"
-- Basic nodes registration
---------------------------
minetest.register_node("cratermg:stone", {
description = planet_name.." Stone",
tiles = {"default_stone.png^[colorize:#F408"},
groups = {cracky = 2},
drop = "cratermg:sediment",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment", {
description = planet_name.." Sediments",
tiles = {"default_cobble.png^[colorize:#F408"},
groups = {cracky = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:dust", {
description = planet_name.." Dust",
tiles = {"default_sand.png^[colorize:#F408"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
-- Ore nodes registration
-------------------------
minetest.register_node("cratermg:stone_with_coal", {
description = "Coal Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_coal.png"},
groups = {cracky = 3},
drop = "default:coal_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_iron", {
description = "Iron Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_iron.png"},
groups = {cracky = 2},
drop = "default:iron_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_copper", {
description = "Copper Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_copper.png"},
groups = {cracky = 2},
drop = "default:copper_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_tin", {
description = "Tin Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_tin.png"},
groups = {cracky = 2},
drop = "default:tin_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_mese", {
description = "Mese Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_mese.png"},
groups = {cracky = 1},
drop = "default:mese_crystal",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_gold", {
description = "Gold Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_gold.png"},
groups = {cracky = 2},
drop = "default:gold_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:stone_with_diamond", {
description = "Diamond Ore",
tiles = {"default_stone.png^[colorize:#F408^default_mineral_diamond.png"},
groups = {cracky = 1},
drop = "default:diamond",
sounds = default.node_sound_stone_defaults(),
})
-- Mineral nodes registration
-----------------------------
minetest.register_node("cratermg:sediment_with_iron", {
description = "Iron Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_iron.png"},
groups = {cracky = 2},
drop = "default:iron_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment_with_copper", {
description = "Copper Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_copper.png"},
groups = {cracky = 2},
drop = "default:copper_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment_with_tin", {
description = "Tin Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_tin.png"},
groups = {cracky = 2},
drop = "default:tin_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment_with_mese", {
description = "Mese Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_mese.png"},
groups = {cracky = 1},
drop = "default:mese_crystal",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment_with_gold", {
description = "Gold Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_gold.png"},
groups = {cracky = 2},
drop = "default:gold_lump",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("cratermg:sediment_with_diamond", {
description = "Diamond Ore",
tiles = {"default_cobble.png^[colorize:#F408^default_mineral_diamond.png"},
groups = {cracky = 1},
drop = "default:diamond",
sounds = default.node_sound_stone_defaults(),
})
-- Override config
------------------
cratermg.materials.vacuum = minetest.get_content_id("air")
cratermg.materials.hills = minetest.get_content_id("cratermg:stone")
cratermg.materials.mare = minetest.get_content_id("cratermg:stone")
cratermg.materials.crater_edge = minetest.get_content_id("cratermg:sediment")
cratermg.materials.crater_fill = minetest.get_content_id("cratermg:sediment")
cratermg.materials.dust = minetest.get_content_id("cratermg:dust")
-- Ores registration
--------------------
cratermg.register_ore({
noise = {scale = 1, octaves = 3, persist = 1, offset = -1.3},
ore = "cratermg:stone_with_mese", spawns_in = "cratermg:stone"
})
cratermg.register_ore({
noise = {scale = 1, octaves = 3, persist = 1, offset = -1.3},
ore = "cratermg:stone_with_diamond", spawns_in = "cratermg:stone"
})
cratermg.register_ore({
noise = {scale = 1, octaves = 1, persist = 1, offset = -0.3},
ore = "cratermg:stone_with_iron", spawns_in = "cratermg:stone"
})
cratermg.register_ore({
noise = {scale = 1, octaves = 1, persist = 1, offset = -0.4},
ore = "cratermg:stone_with_copper", spawns_in = "cratermg:stone"
})
cratermg.register_ore({
noise = {scale = 1, octaves = 2, persist = 1, offset = -1},
ore = "cratermg:stone_with_tin", spawns_in = "cratermg:stone"
})
cratermg.register_ore({
noise = {scale = 2, octaves = 2, persist = 1, offset = -1.5},
ore = "cratermg:stone_with_coal", spawns_in = "cratermg:stone"
})
-- Debris registration
----------------------
cratermg.register_debris({
name = minetest.get_name_from_content_id(cratermg.materials.crater_fill),
chance = 20,
})
cratermg.register_debris({
name = "cratermg:sediment_with_copper",
chance = 1,
})
cratermg.register_debris({
name = "cratermg:sediment_with_iron",
chance = 5,
})
cratermg.register_debris({
name = "cratermg:sediment_with_tin",
chance = 1,
})
cratermg.register_debris({
name = "cratermg:sediment_with_mese",
chance = 1,
})
cratermg.register_debris({
name = "cratermg:sediment_with_diamond",
chance = 1,
})
cratermg.register_debris({
name = "cratermg:sediment_with_gold",
chance = 2,
})