This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathblocks.lua
636 lines (549 loc) · 16.4 KB
/
blocks.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
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
632
633
634
635
636
--------------------------------------------------
--ADDITIONAL BLOCKS
------------------------------------------------
--REDEFINE
--override default textures
--yellowish clay
--drop the block, allow plants to grow
minetest.override_item("default:clay", {
description = "Clay",
tiles = {"aotearoa_clay.png"},
groups = {crumbly = 3, soil = 1},
drop = 'default:clay',--'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(),
})
--slabs for clay
stairs.register_stair_and_slab(
"default_clay",
"default:clay",
{crumbly = 3},
{"aotearoa_clay.png" },
"Clay Stair",
"Clay Slab",
default.node_sound_dirt_defaults()
)
----------------------------------------------------
-- GRAVEL
minetest.register_node("aotearoa:gravel_with_algae", {
description = "Gravel with Algae",
tiles = {"aotearoa_gravel_with_algae.png"},
groups = {crumbly = 2, falling_node = 1},
sounds = default.node_sound_gravel_defaults(),
drop = {
max_items = 1,
items = {
{items = {'default:flint'}, rarity = 16},
{items = {'default:gravel'}}
}
}
})
-----------------------------------------------------
--CLAY
minetest.register_node("aotearoa:gumland_hardpan", {
description = "Gumland Hardpan",
tiles = {"aotearoa_gumland_hardpan.png"},
groups = {crumbly = 2},
drop = {
max_items = 2,
items = {
{items = {"aotearoa:kauri_gum"}, rarity = 15 },
{items = {'default:clay'} }
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
minetest.register_node("aotearoa:gumland_soil", {
description = "Gumland Soil",
tiles = {"aotearoa_gumland_soil.png"},
tiles = {
"aotearoa_gumland_soil.png",
"aotearoa_gumland_hardpan.png",
{name ="aotearoa_gumland_hardpan.png".."^aotearoa_gumland_soil_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3},
drop = {
max_items = 2,
items = {
{items = {"aotearoa:kauri_gum"}, rarity = 20 },
{items = {'default:clay'} }
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
--------------------------------------------------
--DIRT BLOCKS
--differently textured versions of dirt.
aotearoa.dirtlist = {
{"dirt_with_dark_litter", "Dirt with Dark Litter", "aotearoa_dirt_with_dark_litter_bottom.png","aotearoa_dirt_with_dark_litter_bottom.png"},
{"dirt_with_moss", "Dirt with Moss", "default_dirt.png", "default_rainforest_litter.png"},
{"dirt_with_beech_litter", "Dirt with Beech Litter", "aotearoa_dirt_with_dark_litter_bottom.png", "aotearoa_dirt_with_dark_litter_bottom.png"},
{"dirt_with_dry_litter", "Dirt with Dry Litter", "default_dirt.png", "default_dirt.png"},
}
for i in ipairs(aotearoa.dirtlist) do
local dirtname = aotearoa.dirtlist[i][1]
local dirtdesc = aotearoa.dirtlist[i][2]
local bottext = aotearoa.dirtlist[i][3]
local sidetext = aotearoa.dirtlist[i][4]
minetest.register_node("aotearoa:"..dirtname, {
description = dirtdesc,
tiles = {
"aotearoa_"..dirtname..".png",
bottext,
{name =sidetext.."^aotearoa_"..dirtname.."_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
drop = "default:dirt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
end
--------------------------------------------------
--SAND BLOCKS
--differently textured versions of sand
aotearoa.sandlist = {
{"iron_sand", "Iron-sand"},
{"volcanic_sand", "Volcanic Sand"},
{"river_sand", "River Sand"},
}
for i in ipairs(aotearoa.sandlist) do
local sandname = aotearoa.sandlist[i][1]
local sanddesc = aotearoa.sandlist[i][2]
minetest.register_node("aotearoa:"..sandname, {
description = sanddesc,
tiles = { "aotearoa_"..sandname..".png"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
sounds = default.node_sound_sand_defaults(),
})
end
--cook volcanic_sand to obsidian
minetest.register_craft({
type = "cooking",
output = "default:obsidian",
recipe = "aotearoa:volcanic_sand",
})
--------------------------------------------------
--PEAT BLOCKS
minetest.register_node("aotearoa:peat", {
description = "Peat",
tiles = {
"aotearoa_peat.png",
},
groups = {crumbly = 3},
drop = {
max_items = 1,
items = {
{items = {"default:iron_lump"}, rarity = 200 },
{items = {"aotearoa:peat"} }
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
aotearoa.peatlist = {
{"restiad_peat", "Restiad Peat"},
{"forest_peat", "Forest Peat"}
}
for i in ipairs(aotearoa.peatlist) do
local dirtname = aotearoa.peatlist[i][1]
local dirtdesc = aotearoa.peatlist[i][2]
minetest.register_node("aotearoa:"..dirtname, {
description = dirtdesc,
tiles = {
"aotearoa_"..dirtname..".png",
"aotearoa_peat.png",
{name ="aotearoa_peat.png^aotearoa_"..dirtname.."_side.png",
tileable_vertical = false}
},
groups = {crumbly = 3},
drop = {
max_items = 1,
items = {
{items = {"default:iron_lump"}, rarity = 1000 },
{items = {"aotearoa:peat"} }
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
end
----------------------------------------------------
--SILT
--Silt
minetest.register_node("aotearoa:silt", {
description = "Silt",
tiles = {
"aotearoa_silt.png",
},
groups = {crumbly = 3, soil = 1,},
sounds = default.node_sound_dirt_defaults({
}),
})
--slab for silt
stairs.register_stair_and_slab(
"aotearoa_silt",
"aotearoa:silt",
{crumbly = 3},
{"aotearoa_silt.png" },
"Silt Stair",
"Silt Slab",
default.node_sound_dirt_defaults()
)
--Mud (for swamps and estuaries)
--this is so you sink in
minetest.register_node("aotearoa:mud_sinking", {
description = "Sinking Mud",
tiles = {
{
name = "aotearoa_mud_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
paramtype = "light",
walkable = false,
--diggable = false,
--pointable = false,
buildable_to = true,
drowning = 1,
post_effect_color = {a = 250, r = 20, g = 20, b = 20},
groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
drop = "aotearoa:silt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_water_footstep", gain = 0.2},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
--solid mud
minetest.register_node("aotearoa:mud", {
description = "Mud",
tiles = {
"aotearoa_mud.png",
},
--walkable = false,
--diggable = false,
--pointable = false,
--buildable_to = true,
groups = {crumbly = 3, puts_out_fire = 1},
drop = "aotearoa:silt",
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
-----------------------------------------------
--Boiling Mud
minetest.register_node("aotearoa:boiling_mud_source", {
description = "Boiling Mud Source",
drawtype = "liquid",
tiles = {
{
name = "aotearoa_boiling_mud_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
},
},
special_tiles = {
{
name = "aotearoa_boiling_mud_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
backface_culling = false,
},
},
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "aotearoa:silt",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "aotearoa:boiling_mud_flowing",
liquid_alternative_source = "aotearoa:boiling_mud_source",
liquid_viscosity = 7,
liquid_renewable = false,
damage_per_second = 1,
post_effect_color = {a = 200, r = 73, g = 64, b = 55},
groups = {liquid = 2},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
minetest.register_node("aotearoa:boiling_mud_flowing", {
description = "Boiling Mud Lava",
drawtype = "flowingliquid",
tiles = {"aotearoa_boiling_mud.png"},
special_tiles = {
{
name = "aotearoa_boiling_mud_flowing_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.3,
},
},
{
name = "aotearoa_boiling_mud_flowing_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.3,
},
},
},
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "aotearoa:boiling_mud_flowing",
liquid_alternative_source = "aotearoa:boiling_mud_source",
liquid_viscosity = 7,
liquid_renewable = false,
liquid_range = 2,
damage_per_second = 1,
post_effect_color = {a = 200, r = 73, g = 64, b = 55},
groups = {liquid = 2, not_in_creative_inventory = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "aotearoa_mud", gain = 0.4},
dug = {name = "aotearoa_mud", gain = 0.4},
}),
})
-----------------------------------------------------
--SEASHELLS
minetest.register_node("aotearoa:seashells", {
description = "Seashells",
tiles = {
"aotearoa_seashells.png",
},
groups = {crumbly = 3, falling_node = 1},
sounds = default.node_sound_gravel_defaults({
}),
})
---------------------------------------------------------
--STONE
--note: hardness. default stone = 3, obsidian = 1
-- note: the metamorphic relations here (cooking) are an extreme simplification in places.
aotearoa.stonelist = {
{"pounamu", "Pounamu", 1, 1,},
{"pale_sandstone", "Pale Sandstone",3,2, "sediment", "default:sand",},
{"grey_sandstone", "Grey Sandstone",3,2, "sediment", "aotearoa:river_sand",},
{"siltstone", "Siltstone", 3, 2, "sediment", "aotearoa:silt",},
{"claystone", "Claystone", 3, 2, "sediment", "default:clay",},
{"conglomerate", "Conglomerate", 3, 2, "sediment", "default:gravel",},
{"schist", "Schist", 2, 2, "cooked", "", {"aotearoa:greywacke", "aotearoa:andesite", "aotearoa:scoria", "aotearoa:basalt"}},
{"coquina_limestone", "Coquina Limestone", 3, 2, "sediment", "aotearoa:seashells",},
{"limestone", "Limestone", 2, 2, "cooked", "", {"aotearoa:coquina_limestone","default:coral"}},
{"concrete","Concrete",3,2,},
{"andesite", "Andesite", 3, 2,},
{"granite", "Granite", 1, 1,},
{"greywacke", "Greywacke", 3, 2, "cooked", "", {"aotearoa:siltstone","aotearoa:claystone", "aotearoa:pale_sandstone","aotearoa:grey_sandstone","default:sandstone", "default:silver_sandstone", "default:desert_sandstone"}},
{"gneiss", "Gneiss", 1, 1, "cooked", "", {"aotearoa:schist","aotearoa:granite"}},
{"scoria", "Scoria", 3, 2,},
{"basalt", "Basalt", 2, 2,},
}
for i in ipairs(aotearoa.stonelist) do
local stonename = aotearoa.stonelist[i][1]
local stonedesc = aotearoa.stonelist[i][2]
local hardness = aotearoa.stonelist[i][3]
local hardness2 = aotearoa.stonelist[i][4]
local type = aotearoa.stonelist[i][5]
local sediment = aotearoa.stonelist[i][6]
local precursor = aotearoa.stonelist[i][7]
--make soft sedimentary rocks from/into sediment
--and allow them to be dug
local g = nil
if type == "sediment" then
g = {cracky = hardness, crumbly = 1, soft_stone = 1}
--for bricks, blocks
g2 = {cracky = hardness2, soft_stone = 1}
minetest.register_craft({
output = "aotearoa:"..stonename,
recipe = {
{sediment, sediment,""},
{sediment, sediment,""},
{"", "",""},
}
})
minetest.register_craft({
output = sediment.." 4",
recipe = {
{"aotearoa:"..stonename},
}
})
else
g = {cracky = hardness, stone = 1}
--for bricks, blocks
g2 = {cracky = hardness2, stone = 1}
end
--can get raw stone by cooking something else
if type == "cooked" then
--go through list of precusors
for p, v in pairs(precursor) do
minetest.register_craft({
type = "cooking",
output = "aotearoa:"..stonename,
recipe = v,
cooktime = 120,
})
end
end
--register raw
minetest.register_node("aotearoa:"..stonename, {
description = stonedesc,
tiles = {"aotearoa_"..stonename..".png"},
groups = g,
drop = "aotearoa:"..stonename,
sounds = default.node_sound_stone_defaults(),
})
--blocks and bricks
minetest.register_node("aotearoa:"..stonename.."brick", {
description = stonedesc.." Brick",
tiles = {"aotearoa_"..stonename.."brick.png"},
groups = g2,
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("aotearoa:"..stonename.."_block", {
description = stonedesc.. " Block",
tiles = {"aotearoa_"..stonename.."_block.png"},
groups = g2,
sounds = default.node_sound_stone_defaults(),
})
--stairs and slabs
--raw
stairs.register_stair_and_slab(
"aotearoa_"..stonename,
"aotearoa:"..stonename,
{cracky = hardness,},
{"aotearoa_"..stonename..".png" },
stonedesc.." Stair",
stonedesc.." Slab",
default.node_sound_stone_defaults()
)
--brick
stairs.register_stair_and_slab(
"aotearoa_"..stonename.."brick",
"aotearoa:"..stonename.."brick",
{cracky = hardness2,},
{"aotearoa_"..stonename.."brick.png" },
stonedesc.." Brick Stair",
stonedesc.." Brick Slab",
default.node_sound_stone_defaults()
)
--block
stairs.register_stair_and_slab(
"aotearoa_"..stonename.."_block",
"aotearoa:"..stonename.."_block",
{cracky = hardness2,},
{"aotearoa_"..stonename.."_block.png" },
stonedesc.." Block Stair",
stonedesc.." Block Slab",
default.node_sound_stone_defaults()
)
--craft
minetest.register_craft({
output = "aotearoa:"..stonename.."brick 4",
recipe = {
{"aotearoa:"..stonename, "aotearoa:"..stonename,""},
{"aotearoa:"..stonename, "aotearoa:"..stonename,""},
{"", "",""},
}
})
minetest.register_craft({
output = "aotearoa:"..stonename.."_block 9",
recipe = {
{"aotearoa:"..stonename, "aotearoa:"..stonename, "aotearoa:"..stonename},
{"aotearoa:"..stonename, "aotearoa:"..stonename, "aotearoa:"..stonename},
{"aotearoa:"..stonename, "aotearoa:"..stonename, "aotearoa:"..stonename},
}
})
end
------------------------------------------
--MINERALS
---------------------
--Quartz with gold
minetest.register_node("aotearoa:quartz_with_gold", {
description = "Quartz with Gold",
tiles = {"aotearoa_quartz_with_gold.png"},
groups = {cracky = 2},
drop = "default:gold_lump",
sounds = default.node_sound_stone_defaults(),
})
-------------------
--Limonite (iron ore)
minetest.register_node("aotearoa:limonite", {
description = "Limonite",
tiles = {"aotearoa_limonite.png"},
groups = {cracky = 3},
drop = "default:iron_lump",
sounds = default.node_sound_stone_defaults(),
})
-------------------
--chalcopyrite (copper ore)
minetest.register_node("aotearoa:chalcopyrite", {
description = "Chalcopyrite",
tiles = {"aotearoa_chalcopyrite.png"},
groups = {cracky = 3},
drop = "default:copper_lump",
sounds = default.node_sound_stone_defaults(),
})
-------------------
--cassiterite (tin ore)
minetest.register_node("aotearoa:cassiterite", {
description = "Cassiterite",
tiles = {"aotearoa_cassiterite.png"},
groups = {cracky = 3},
drop = "default:tin_lump",
sounds = default.node_sound_stone_defaults(),
})
---------------------------------------------
--ROTTEN WOOD
minetest.register_node("aotearoa:rotten_wood", {
description = "Rotten Wood",
tiles = {
"aotearoa_rotten_wood_top.png",
"aotearoa_rotten_wood_top.png",
"aotearoa_rotten_wood.png"
},
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy = 3, oddly_breakable_by_hand = 3, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node,
})