1 local S
= minetest
.get_translator("mcl_core")
3 -- Simple solid cubic nodes, most of them are the ground materials and simple building blocks
5 local translucent_ice
= minetest
.settings
:get_bool("mcl_translucent_ice", false)
7 if translucent_ice
then
8 ice_drawtype
= "glasslike"
10 ice_drawtype
= "normal"
13 minetest
.register_node("mcl_core:stone", {
14 description
= S("Stone"),
15 _doc_items_longdesc
= S("One of the most common blocks in the world, almost the entire underground consists of stone. It sometimes contains ores. Stone may be created when water meets lava."),
16 _doc_items_hidden
= false,
17 tiles
= {"default_stone.png"},
18 is_ground_content
= true,
20 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
21 drop
= 'mcl_core:cobble',
22 sounds
= mcl_sounds
.node_sound_stone_defaults(),
23 _mcl_blast_resistance
= 6,
27 minetest
.register_node("mcl_core:stone_with_coal", {
28 description
= S("Coal Ore"),
29 _doc_items_longdesc
= S("Some coal contained in stone, it is very common and can be found inside stone in medium to large clusters at nearly every height."),
30 _doc_items_hidden
= false,
31 tiles
= {"mcl_core_coal_ore.png"},
32 is_ground_content
= true,
34 groups
= {pickaxey
=1, building_block
=1, material_stone
=1},
35 drop
= 'mcl_core:coal_lump',
36 sounds
= mcl_sounds
.node_sound_stone_defaults(),
37 _mcl_blast_resistance
= 3,
41 minetest
.register_node("mcl_core:stone_with_iron", {
42 description
= S("Iron Ore"),
43 _doc_items_longdesc
= S("Some iron contained in stone, it is prety common and can be found below sea level."),
44 tiles
= {"mcl_core_iron_ore.png"},
45 is_ground_content
= true,
47 groups
= {pickaxey
=3, building_block
=1, material_stone
=1},
48 drop
= 'mcl_core:stone_with_iron',
49 sounds
= mcl_sounds
.node_sound_stone_defaults(),
50 _mcl_blast_resistance
= 3,
55 minetest
.register_node("mcl_core:stone_with_gold", {
56 description
= S("Gold Ore"),
57 _doc_items_longdesc
= S("This stone contains pure gold, a rare metal."),
58 tiles
= {"mcl_core_gold_ore.png"},
59 is_ground_content
= true,
61 groups
= {pickaxey
=4, building_block
=1, material_stone
=1},
62 drop
= "mcl_core:stone_with_gold",
63 sounds
= mcl_sounds
.node_sound_stone_defaults(),
64 _mcl_blast_resistance
= 3,
68 local redstone_timer
= 68.28
69 local redstone_ore_activate
= function(pos
)
70 minetest
.swap_node(pos
, {name
="mcl_core:stone_with_redstone_lit"})
71 local t
= minetest
.get_node_timer(pos
)
72 t
:start(redstone_timer
)
74 minetest
.register_node("mcl_core:stone_with_redstone", {
75 description
= S("Redstone Ore"),
76 _doc_items_longdesc
= S("Redstone ore is commonly found near the bottom of the world. It glows when it is punched or walked upon."),
77 tiles
= {"mcl_core_redstone_ore.png"},
78 is_ground_content
= true,
80 groups
= {pickaxey
=4, building_block
=1, material_stone
=1},
85 items
= {"mesecons:redstone 4"},
89 items
= {"mesecons:redstone 5"},
93 sounds
= mcl_sounds
.node_sound_stone_defaults(),
94 on_punch
= redstone_ore_activate
,
95 on_walk_over
= redstone_ore_activate
, -- Uses walkover mod
96 _mcl_blast_resistance
= 3,
100 local redstone_ore_reactivate
= function(pos
)
101 local t
= minetest
.get_node_timer(pos
)
102 t
:start(redstone_timer
)
104 -- Light the redstone ore up when it has been touched
105 minetest
.register_node("mcl_core:stone_with_redstone_lit", {
106 description
= S("Lit Redstone Ore"),
107 _doc_items_create_entry
= false,
108 tiles
= {"mcl_core_redstone_ore.png"},
111 is_ground_content
= true,
113 groups
= {pickaxey
=4, not_in_creative_inventory
=1, material_stone
=1},
118 items
= {"mesecons:redstone 4"},
122 items
= {"mesecons:redstone 5"},
126 sounds
= mcl_sounds
.node_sound_stone_defaults(),
127 -- Reset timer after re-punching or stepping on
128 on_punch
= redstone_ore_reactivate
,
129 on_walk_over
= redstone_ore_reactivate
, -- Uses walkover mod
130 -- Turn back to normal node after some time has passed
131 on_timer
= function(pos
, elapsed
)
132 minetest
.swap_node(pos
, {name
="mcl_core:stone_with_redstone"})
134 _mcl_blast_resistance
= 3,
138 minetest
.register_node("mcl_core:stone_with_lapis", {
139 description
= S("Lapis Lazuli Ore"),
140 _doc_items_longdesc
= S("Lapis lazuli ore is the ore of lapis lazuli. It can be rarely found in clusters near the bottom of the world."),
141 tiles
= {"mcl_core_lapis_ore.png"},
142 is_ground_content
= true,
144 groups
= {pickaxey
=3, building_block
=1, material_stone
=1},
148 {items
= {'mcl_dye:blue 8'},rarity
= 5},
149 {items
= {'mcl_dye:blue 7'},rarity
= 5},
150 {items
= {'mcl_dye:blue 6'},rarity
= 5},
151 {items
= {'mcl_dye:blue 5'},rarity
= 5},
152 {items
= {'mcl_dye:blue 4'}},
155 sounds
= mcl_sounds
.node_sound_stone_defaults(),
156 _mcl_blast_resistance
= 3,
160 minetest
.register_node("mcl_core:stone_with_emerald", {
161 description
= S("Emerald Ore"),
162 _doc_items_longdesc
= S("Emerald ore is the ore of emeralds. It is very rare and can be found alone, not in clusters."),
163 tiles
= {"mcl_core_emerald_ore.png"},
164 is_ground_content
= true,
166 groups
= {pickaxey
=4, building_block
=1, material_stone
=1},
167 drop
= "mcl_core:emerald",
168 sounds
= mcl_sounds
.node_sound_stone_defaults(),
169 _mcl_blast_resistance
= 3,
173 minetest
.register_node("mcl_core:stone_with_diamond", {
174 description
= S("Diamond Ore"),
175 _doc_items_longdesc
= S("Diamond ore is rare and can be found in clusters near the bottom of the world."),
176 tiles
= {"mcl_core_diamond_ore.png"},
177 is_ground_content
= true,
179 groups
= {pickaxey
=4, building_block
=1, material_stone
=1},
180 drop
= "mcl_core:diamond",
181 sounds
= mcl_sounds
.node_sound_stone_defaults(),
182 _mcl_blast_resistance
= 3,
186 minetest
.register_node("mcl_core:stonebrick", {
187 description
= S("Stone Bricks"),
188 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
189 tiles
= {"default_stone_brick.png"},
191 groups
= {pickaxey
=1, stone
=1, stonebrick
=1, building_block
=1, material_stone
=1},
192 sounds
= mcl_sounds
.node_sound_stone_defaults(),
193 is_ground_content
= false,
194 _mcl_blast_resistance
= 6,
198 minetest
.register_node("mcl_core:stonebrickcarved", {
199 description
= S("Chiseled Stone Bricks"),
200 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
201 tiles
= {"mcl_core_stonebrick_carved.png"},
203 groups
= {pickaxey
=1, stone
=1, stonebrick
=1, building_block
=1, material_stone
=1},
204 sounds
= mcl_sounds
.node_sound_stone_defaults(),
205 is_ground_content
= false,
206 _mcl_blast_resistance
= 6,
210 minetest
.register_node("mcl_core:stonebrickcracked", {
211 description
= S("Cracked Stone Bricks"),
212 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
213 tiles
= {"mcl_core_stonebrick_cracked.png"},
215 groups
= {pickaxey
=1, stone
=1, stonebrick
=1, building_block
=1, material_stone
=1},
216 sounds
= mcl_sounds
.node_sound_stone_defaults(),
217 is_ground_content
= false,
218 _mcl_blast_resistance
= 6,
222 minetest
.register_node("mcl_core:stonebrickmossy", {
223 description
= S("Mossy Stone Bricks"),
224 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
225 tiles
= {"mcl_core_stonebrick_mossy.png"},
227 groups
= {pickaxey
=1, stone
=1, stonebrick
=1, building_block
=1, material_stone
=1},
228 sounds
= mcl_sounds
.node_sound_stone_defaults(),
229 is_ground_content
= false,
230 _mcl_blast_resistance
= 6,
234 minetest
.register_node("mcl_core:stone_smooth", {
235 description
= S("Polished Stone"),
236 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
237 tiles
= {"mcl_stairs_stone_slab_top.png"},
239 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
240 sounds
= mcl_sounds
.node_sound_stone_defaults(),
241 is_ground_content
= false,
242 _mcl_blast_resistance
= 6,
246 minetest
.register_node("mcl_core:granite", {
247 description
= S("Granite"),
248 _doc_items_longdesc
= S("Granite is an igneous rock."),
249 tiles
= {"mcl_core_granite.png"},
250 is_ground_content
= true,
252 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
253 sounds
= mcl_sounds
.node_sound_stone_defaults(),
254 _mcl_blast_resistance
= 6,
258 minetest
.register_node("mcl_core:granite_smooth", {
259 description
= S("Polished Granite"),
260 _doc_items_longdesc
= S("Polished granite is a decorative building block made from granite."),
261 tiles
= {"mcl_core_granite_smooth.png"},
263 is_ground_content
= false,
264 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
265 sounds
= mcl_sounds
.node_sound_stone_defaults(),
266 _mcl_blast_resistance
= 6,
270 minetest
.register_node("mcl_core:andesite", {
271 description
= S("Andesite"),
272 _doc_items_longdesc
= S("Andesite is an igneous rock."),
273 tiles
= {"mcl_core_andesite.png"},
274 is_ground_content
= true,
276 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
277 sounds
= mcl_sounds
.node_sound_stone_defaults(),
278 _mcl_blast_resistance
= 6,
282 minetest
.register_node("mcl_core:andesite_smooth", {
283 description
= S("Polished Andesite"),
284 _doc_items_longdesc
= S("Polished andesite is a decorative building block made from andesite."),
285 tiles
= {"mcl_core_andesite_smooth.png"},
286 is_ground_content
= false,
288 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
289 sounds
= mcl_sounds
.node_sound_stone_defaults(),
290 _mcl_blast_resistance
= 30,
294 minetest
.register_node("mcl_core:diorite", {
295 description
= S("Diorite"),
296 _doc_items_longdesc
= S("Diorite is an igneous rock."),
297 tiles
= {"mcl_core_diorite.png"},
298 is_ground_content
= true,
300 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
301 sounds
= mcl_sounds
.node_sound_stone_defaults(),
302 _mcl_blast_resistance
= 6,
306 minetest
.register_node("mcl_core:diorite_smooth", {
307 description
= S("Polished Diorite"),
308 _doc_items_longdesc
= S("Polished diorite is a decorative building block made from diorite."),
309 tiles
= {"mcl_core_diorite_smooth.png"},
310 is_ground_content
= false,
312 groups
= {pickaxey
=1, stone
=1, building_block
=1, material_stone
=1},
313 sounds
= mcl_sounds
.node_sound_stone_defaults(),
314 _mcl_blast_resistance
= 6,
319 minetest
.register_node("mcl_core:dirt_with_grass", {
320 description
= S("Grass Block"),
321 _doc_items_longdesc
= S("A grass block is dirt with a grass cover. Grass blocks are resourceful blocks which allow the growth of all sorts of plants. They can be turned into farmland with a hoe and turned into grass paths with a shovel. In light, the grass slowly spreads onto dirt nearby. Under an opaque block or a liquid, a grass block may turn back to dirt."),
322 _doc_items_hidden
= false,
323 paramtype2
= "color",
324 tiles
= {"mcl_core_grass_block_top.png", { name
="default_dirt.png", color
="white" }},
325 overlay_tiles
= {"mcl_core_grass_block_top.png", "", {name
="mcl_core_grass_block_side_overlay.png", tileable_vertical
=false}},
326 palette
= "mcl_core_palette_grass.png",
329 is_ground_content
= true,
331 groups
= {handy
=1,shovely
=1,dirt
=2,grass_block
=1, grass_block_no_snow
=1, soil
=1, soil_sapling
=2, soil_sugarcane
=1, cultivatable
=2, spreading_dirt_type
=1, enderman_takable
=1, building_block
=1},
332 drop
= 'mcl_core:dirt',
333 sounds
= mcl_sounds
.node_sound_dirt_defaults({
334 footstep
= {name
="default_grass_footstep", gain
=0.4},
336 on_construct
= function(pos
)
337 local node
= minetest
.get_node(pos
)
338 if node
.param2
== 0 then
339 local new_node
= mcl_core
.get_grass_block_type(pos
)
340 if new_node
.param2
~= 0 or new_node
.name
~= "mcl_core:dirt_with_grass" then
341 minetest
.set_node(pos
, new_node
)
344 return mcl_core
.on_snowable_construct(pos
)
346 _mcl_snowed
= "mcl_core:dirt_with_grass_snow",
347 _mcl_blast_resistance
= 0.5,
350 mcl_core
.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true)
352 minetest
.register_node("mcl_core:grass_path", {
353 tiles
= {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"},
354 description
= S("Grass Path"),
355 _doc_items_longdesc
= S("Grass paths are a decorative variant of grass blocks. Their top has a different color and they are a bit lower than grass blocks, making them useful to build footpaths. Grass paths can be created with a shovel. A grass path turns into dirt when it is below a solid block."),
356 drop
= "mcl_core:dirt",
357 is_ground_content
= true,
358 drawtype
= "nodebox",
363 -- 15/16 of the normal height
364 {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
367 groups
= {handy
=1,shovely
=1, cultivatable
=2, dirtifies_below_solid
=1, dirtifier
=1, deco_block
=1 },
368 sounds
= mcl_sounds
.node_sound_dirt_defaults({
369 footstep
= {name
="default_grass_footstep", gain
=0.4},
371 _mcl_blast_resistance
= 0.65,
375 -- TODO: Add particles
376 minetest
.register_node("mcl_core:mycelium", {
377 description
= S("Mycelium"),
378 _doc_items_longdesc
= S("Mycelium is a type of dirt and the ideal soil for mushrooms. Unlike other dirt-type blocks, it can not be turned into farmland with a hoe. In light, mycelium slowly spreads over nearby dirt. Under an opaque block or a liquid, it eventually turns back into dirt."),
379 tiles
= {"mcl_core_mycelium_top.png", "default_dirt.png", {name
="mcl_core_mycelium_side.png", tileable_vertical
=false}},
380 is_ground_content
= true,
382 groups
= {handy
=1,shovely
=1, dirt
=2,spreading_dirt_type
=1, building_block
=1},
383 drop
= 'mcl_core:dirt',
384 sounds
= mcl_sounds
.node_sound_dirt_defaults({
385 footstep
= {name
="default_grass_footstep", gain
=0.4},
388 on_construct
= mcl_core
.on_snowable_construct
,
389 _mcl_snowed
= "mcl_core:mycelium_snow",
390 _mcl_blast_resistance
= 0.5,
393 mcl_core
.register_snowed_node("mcl_core:mycelium_snow", "mcl_core:mycelium")
395 minetest
.register_node("mcl_core:podzol", {
396 description
= S("Podzol"),
397 _doc_items_longdesc
= S("Podzol is a type of dirt found in taiga forests. Only a few plants are able to survive on it."),
398 tiles
= {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name
="mcl_core_dirt_podzol_side.png", tileable_vertical
=false}},
399 is_ground_content
= true,
401 groups
= {handy
=1,shovely
=3, dirt
=2,soil
=1, soil_sapling
=2, soil_sugarcane
=1, enderman_takable
=1, building_block
=1},
402 drop
= 'mcl_core:dirt',
403 sounds
= mcl_sounds
.node_sound_dirt_defaults(),
404 on_construct
= mcl_core
.on_snowable_construct
,
405 _mcl_snowed
= "mcl_core:podzol_snow",
406 _mcl_blast_resistance
= 0.5,
409 mcl_core
.register_snowed_node("mcl_core:podzol_snow", "mcl_core:podzol")
411 minetest
.register_node("mcl_core:dirt", {
412 description
= S("Dirt"),
413 _doc_items_longdesc
= S("Dirt acts as a soil for a few plants. When in light, this block may grow a grass or mycelium cover if such blocks are nearby."),
414 _doc_items_hidden
= false,
415 tiles
= {"default_dirt.png"},
416 is_ground_content
= true,
418 groups
= {handy
=1,shovely
=1, dirt
=1,soil
=1, soil_sapling
=2, soil_sugarcane
=1, cultivatable
=2, enderman_takable
=1, building_block
=1},
419 sounds
= mcl_sounds
.node_sound_dirt_defaults(),
420 _mcl_blast_resistance
= 0.5,
424 minetest
.register_node("mcl_core:coarse_dirt", {
425 description
= S("Coarse Dirt"),
426 _doc_items_longdesc
= S("Coarse dirt acts as a soil for some plants and is similar to dirt, but it will never grow a cover."),
427 tiles
= {"mcl_core_coarse_dirt.png"},
428 is_ground_content
= true,
430 groups
= {handy
=1,shovely
=1, dirt
=3,soil
=1, soil_sugarcane
=1, cultivatable
=1, enderman_takable
=1, building_block
=1},
431 sounds
= mcl_sounds
.node_sound_dirt_defaults(),
432 _mcl_blast_resistance
= 0.5,
436 minetest
.register_node("mcl_core:gravel", {
437 description
= S("Gravel"),
438 _doc_items_longdesc
= S("This block consists of a couple of loose stones and can't support itself."),
439 tiles
= {"default_gravel.png"},
440 is_ground_content
= true,
442 groups
= {handy
=1,shovely
=1, falling_node
=1, enderman_takable
=1, building_block
=1, material_sand
=1},
446 {items
= {'mcl_core:flint'},rarity
= 10},
447 {items
= {'mcl_core:gravel'}}
450 sounds
= mcl_sounds
.node_sound_dirt_defaults({
451 footstep
= {name
="default_gravel_footstep", gain
=0.45},
453 _mcl_blast_resistance
= 0.6,
458 minetest
.register_node("mcl_core:sand", {
459 description
= S("Sand"),
460 _doc_items_longdesc
= S("Sand is found in large quantities at beaches and deserts."),
461 _doc_items_hidden
= false,
462 tiles
= {"default_sand.png"},
463 is_ground_content
= true,
465 groups
= {handy
=1,shovely
=1, falling_node
=1, sand
=1, soil_sugarcane
=1, enderman_takable
=1, building_block
=1, material_sand
=1},
466 sounds
= mcl_sounds
.node_sound_sand_defaults(),
467 _mcl_blast_resistance
= 0.5,
471 minetest
.register_node("mcl_core:sandstone", {
472 description
= S("Sandstone"),
473 _doc_items_hidden
= false,
474 _doc_items_longdesc
= S("Sandstone is compressed sand and is a rather soft kind of stone."),
475 tiles
= {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"},
476 is_ground_content
= true,
478 groups
= {pickaxey
=1, sandstone
=1, normal_sandstone
=1, building_block
=1, material_stone
=1},
479 sounds
= mcl_sounds
.node_sound_stone_defaults(),
480 _mcl_blast_resistance
= 0.8,
484 minetest
.register_node("mcl_core:sandstonesmooth", {
485 description
= S("Cut Sandstone"),
486 _doc_items_longdesc
= S("Cut sandstone is a decorative building block."),
487 tiles
= {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_smooth.png"},
488 is_ground_content
= false,
490 groups
= {pickaxey
=1, sandstone
=1, normal_sandstone
=1, building_block
=1, material_stone
=1},
491 sounds
= mcl_sounds
.node_sound_stone_defaults(),
492 _mcl_blast_resistance
= 0.8,
496 minetest
.register_node("mcl_core:sandstonecarved", {
497 description
= S("Chiseled Sandstone"),
498 _doc_items_longdesc
= S("Chiseled sandstone is a decorative building block."),
499 tiles
= {"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_carved.png"},
500 is_ground_content
= false,
502 groups
= {pickaxey
=1, sandstone
=1, normal_sandstone
=1, building_block
=1, material_stone
=1},
503 sounds
= mcl_sounds
.node_sound_stone_defaults(),
504 _mcl_blast_resistance
= 0.8,
508 minetest
.register_node("mcl_core:sandstonesmooth2", {
509 description
= S("Smooth Sandstone"),
510 _doc_items_hidden
= false,
511 _doc_items_longdesc
= S("Smooth sandstone is compressed sand and is a rather soft kind of stone."),
512 tiles
= {"mcl_core_sandstone_top.png"},
513 is_ground_content
= false,
515 groups
= {pickaxey
=1, sandstone
=1, normal_sandstone
=1, building_block
=1, material_stone
=1},
516 sounds
= mcl_sounds
.node_sound_stone_defaults(),
517 _mcl_blast_resistance
= 0.8,
523 minetest
.register_node("mcl_core:redsand", {
524 description
= S("Red Sand"),
525 _doc_items_longdesc
= S("Red sand is found in large quantities in mesa biomes."),
526 tiles
= {"mcl_core_red_sand.png"},
527 is_ground_content
= true,
529 groups
= {handy
=1,shovely
=1, falling_node
=1, sand
=1, soil_sugarcane
=1, enderman_takable
=1, building_block
=1, material_sand
=1},
530 sounds
= mcl_sounds
.node_sound_sand_defaults(),
531 _mcl_blast_resistance
= 0.5,
535 minetest
.register_node("mcl_core:redsandstone", {
536 description
= S("Red Sandstone"),
537 _doc_items_longdesc
= S("Red sandstone is compressed red sand and is a rather soft kind of stone."),
538 tiles
= {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"},
539 is_ground_content
= true,
541 groups
= {pickaxey
=1, sandstone
=1, red_sandstone
=1, building_block
=1, material_stone
=1},
542 sounds
= mcl_sounds
.node_sound_stone_defaults(),
543 _mcl_blast_resistance
= 0.8,
547 minetest
.register_node("mcl_core:redsandstonesmooth", {
548 description
= S("Cut Red Sandstone"),
549 _doc_items_longdesc
= S("Cut red sandstone is a decorative building block."),
550 tiles
= {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_smooth.png"},
551 is_ground_content
= false,
553 groups
= {pickaxey
=1, sandstone
=1, red_sandstone
=1, building_block
=1, material_stone
=1},
554 sounds
= mcl_sounds
.node_sound_stone_defaults(),
555 _mcl_blast_resistance
= 0.8,
559 minetest
.register_node("mcl_core:redsandstonecarved", {
560 description
= S("Chiseled Red Sandstone"),
561 _doc_items_longdesc
= S("Chiseled red sandstone is a decorative building block."),
562 tiles
= {"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_carved.png"},
563 is_ground_content
= false,
565 groups
= {pickaxey
=1, sandstone
=1, red_sandstone
=1, building_block
=1, material_stone
=1},
566 sounds
= mcl_sounds
.node_sound_stone_defaults(),
567 _mcl_blast_resistance
= 0.8,
571 minetest
.register_node("mcl_core:redsandstonesmooth2", {
572 description
= S("Smooth Red Sandstone"),
573 _doc_items_longdesc
= S("Smooth red sandstone is a decorative building block."),
574 tiles
= {"mcl_core_red_sandstone_top.png"},
575 is_ground_content
= false,
577 groups
= {pickaxey
=1, sandstone
=1, red_sandstone
=1, building_block
=1, material_stone
=1},
578 sounds
= mcl_sounds
.node_sound_stone_defaults(),
579 _mcl_blast_resistance
= 0.8,
585 minetest
.register_node("mcl_core:clay", {
586 description
= S("Clay"),
587 _doc_items_longdesc
= S("Clay is a versatile kind of earth commonly found at beaches underwater."),
588 _doc_items_hidden
= false,
589 tiles
= {"default_clay.png"},
590 is_ground_content
= true,
592 groups
= {handy
=1,shovely
=1, enderman_takable
=1, building_block
=1},
593 drop
= 'mcl_core:clay_lump 4',
594 sounds
= mcl_sounds
.node_sound_dirt_defaults(),
595 _mcl_blast_resistance
= 0.6,
599 minetest
.register_node("mcl_core:brick_block", {
600 -- Original name: “Bricks”
601 description
= S("Brick Block"),
602 _doc_items_longdesc
= S("Brick blocks are a good building material for building solid houses and can take quite a punch."),
603 tiles
= {"default_brick.png"},
604 is_ground_content
= false,
606 groups
= {pickaxey
=1, building_block
=1, material_stone
=1},
607 sounds
= mcl_sounds
.node_sound_stone_defaults(),
608 _mcl_blast_resistance
= 6,
613 minetest
.register_node("mcl_core:bedrock", {
614 description
= S("Bedrock"),
615 _doc_items_longdesc
= S("Bedrock is a very hard type of rock. It can not be broken, destroyed, collected or moved by normal means, unless in Creative Mode.").."\n"..
616 S("In the End dimension, starting a fire on this block will create an eternal fire."),
617 tiles
= {"mcl_core_bedrock.png"},
619 groups
= {creative_breakable
=1, building_block
=1, material_stone
=1},
620 sounds
= mcl_sounds
.node_sound_stone_defaults(),
621 is_ground_content
= false,
622 on_blast
= function() end,
624 _mcl_blast_resistance
= 3600000,
627 -- Eternal fire on top of bedrock, if in the End dimension
628 after_destruct
= function(pos
)
630 if minetest
.get_node(pos
).name
== "mcl_fire:eternal_fire" then
631 minetest
.remove_node(pos
)
634 _on_ignite
= function(player
, pointed_thing
)
635 local pos
= pointed_thing
.under
636 local dim
= mcl_worlds
.pos_to_dimension(pos
)
637 local flame_pos
= {x
= pos
.x
, y
= pos
.y
+ 1, z
= pos
.z
}
638 local fn
= minetest
.get_node(flame_pos
)
639 local pname
= player
:get_player_name()
640 if minetest
.is_protected(flame_pos
, pname
) then
641 return minetest
.record_protection_violation(flame_pos
, pname
)
643 if dim
== "end" and fn
.name
== "air" and pointed_thing
.under
.y
< pointed_thing
.above
.y
then
644 minetest
.set_node(flame_pos
, {name
= "mcl_fire:eternal_fire"})
652 minetest
.register_node("mcl_core:cobble", {
653 description
= S("Cobblestone"),
654 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
655 _doc_items_hidden
= false,
656 tiles
= {"default_cobble.png"},
657 is_ground_content
= false,
659 groups
= {pickaxey
=1, building_block
=1, material_stone
=1},
660 sounds
= mcl_sounds
.node_sound_stone_defaults(),
661 _mcl_blast_resistance
= 6,
665 minetest
.register_node("mcl_core:mossycobble", {
666 description
= S("Mossy Cobblestone"),
667 _doc_items_longdesc
= doc
.sub
.items
.temp
.build
,
668 tiles
= {"default_mossycobble.png"},
669 is_ground_content
= false,
671 groups
= {pickaxey
=1, building_block
=1, material_stone
=1},
672 sounds
= mcl_sounds
.node_sound_stone_defaults(),
673 _mcl_blast_resistance
= 6,
677 minetest
.register_node("mcl_core:coalblock", {
678 description
= S("Block of Coal"),
679 _doc_items_longdesc
= S("Blocks of coal are useful as a compact storage of coal and very useful as a furnace fuel. A block of coal is as efficient as 10 coal."),
680 tiles
= {"default_coal_block.png"},
681 is_ground_content
= false,
683 groups
= {pickaxey
=1, flammable
=1, building_block
=1, material_stone
=1, fire_encouragement
=5, fire_flammability
=5},
684 sounds
= mcl_sounds
.node_sound_stone_defaults(),
685 _mcl_blast_resistance
= 6,
689 minetest
.register_node("mcl_core:ironblock", {
690 description
= S("Block of Iron"),
691 _doc_items_longdesc
= S("A block of iron is mostly a decorative block but also useful as a compact storage of iron ingots."),
692 tiles
= {"default_steel_block.png"},
693 is_ground_content
= false,
695 groups
= {pickaxey
=2, building_block
=1},
696 sounds
= mcl_sounds
.node_sound_metal_defaults(),
697 _mcl_blast_resistance
= 6,
701 minetest
.register_node("mcl_core:goldblock", {
702 description
= S("Block of Gold"),
703 _doc_items_longdesc
= S("A block of gold is mostly a shiny decorative block but also useful as a compact storage of gold ingots."),
704 tiles
= {"default_gold_block.png"},
705 is_ground_content
= false,
707 groups
= {pickaxey
=4, building_block
=1},
708 sounds
= mcl_sounds
.node_sound_metal_defaults(),
709 _mcl_blast_resistance
= 6,
713 minetest
.register_node("mcl_core:diamondblock", {
714 description
= S("Block of Diamond"),
715 _doc_items_longdesc
= S("A block of diamond is mostly a shiny decorative block but also useful as a compact storage of diamonds."),
716 tiles
= {"default_diamond_block.png"},
717 is_ground_content
= false,
719 groups
= {pickaxey
=4, building_block
=1},
720 sounds
= mcl_sounds
.node_sound_stone_defaults(),
721 _mcl_blast_resistance
= 6,
725 minetest
.register_node("mcl_core:lapisblock", {
726 description
= S("Lapis Lazuli Block"),
727 _doc_items_longdesc
= S("A lapis lazuli block is mostly a decorative block but also useful as a compact storage of lapis lazuli."),
728 tiles
= {"mcl_core_lapis_block.png"},
729 is_ground_content
= false,
731 groups
= {pickaxey
=3, building_block
=1},
732 sounds
= mcl_sounds
.node_sound_stone_defaults(),
733 _mcl_blast_resistance
= 3,
737 minetest
.register_node("mcl_core:emeraldblock", {
738 description
= S("Block of Emerald"),
739 _doc_items_longdesc
= S("A block of emerald is mostly a shiny decorative block but also useful as a compact storage of emeralds."),
740 tiles
= {"mcl_core_emerald_block.png"},
741 is_ground_content
= false,
743 groups
= {pickaxey
=4, building_block
=1},
744 sounds
= mcl_sounds
.node_sound_stone_defaults(),
745 _mcl_blast_resistance
= 6,
749 minetest
.register_node("mcl_core:obsidian", {
750 description
= S("Obsidian"),
751 _doc_items_longdesc
= S("Obsidian is an extremely hard mineral with an enourmous blast-resistance. Obsidian is formed when water meets lava."),
752 tiles
= {"default_obsidian.png"},
753 is_ground_content
= true,
754 sounds
= mcl_sounds
.node_sound_stone_defaults(),
756 groups
= {pickaxey
=5, building_block
=1, material_stone
=1},
757 _mcl_blast_resistance
= 1200,
761 minetest
.register_node("mcl_core:ice", {
762 description
= S("Ice"),
763 _doc_items_longdesc
= S("Ice is a solid block usually found in cold areas. It melts near block light sources at a light level of 12 or higher. When it melts or is broken while resting on top of another block, it will turn into a water source."),
764 drawtype
= ice_drawtype
,
765 tiles
= {"default_ice.png"},
766 is_ground_content
= true,
768 use_texture_alpha
= translucent_ice
,
770 groups
= {handy
=1,pickaxey
=1, slippery
=3, building_block
=1},
772 sounds
= mcl_sounds
.node_sound_glass_defaults(),
773 node_dig_prediction
= "mcl_core:water_source",
774 after_dig_node
= function(pos
, oldnode
)
775 mcl_core
.melt_ice(pos
)
777 _mcl_blast_resistance
= 0.5,
781 minetest
.register_node("mcl_core:packed_ice", {
782 description
= S("Packed Ice"),
783 _doc_items_longdesc
= S("Packed ice is a compressed form of ice. It is opaque and solid."),
784 tiles
= {"mcl_core_ice_packed.png"},
785 is_ground_content
= true,
787 groups
= {handy
=1,pickaxey
=1, slippery
=3, building_block
=1},
789 sounds
= mcl_sounds
.node_sound_glass_defaults(),
790 _mcl_blast_resistance
= 0.5,
794 -- Frosted Ice (4 nodes)
797 ice
.increase_age
= function(pos
, ice_near
, first_melt
)
798 -- Increase age of frosted age or turn to water source if too old
799 local nn
= minetest
.get_node(pos
).name
800 local age
= tonumber(string.sub(nn
, -1))
801 local dim
= mcl_worlds
.pos_to_dimension(pos
)
802 if age
== nil then return end
804 minetest
.swap_node(pos
, { name
= "mcl_core:frosted_ice_"..(age
+1) })
806 if dim
~= "nether" then
807 minetest
.set_node(pos
, { name
= "mcl_core:water_source" })
809 minetest
.remove_node(pos
)
812 -- Spread aging to neighbor blocks, but not recursively
813 if first_melt
and i
== 3 then
814 for j
=1, #ice_near
do
815 ice
.increase_age(ice_near
[j
], false)
819 local use_doc
= i
== 0
822 longdesc
= S("Frosted ice is a short-lived solid block. It melts into a water source within a few seconds.")
824 minetest
.register_node("mcl_core:frosted_ice_"..i
, {
825 description
= S("Frosted Ice"),
826 _doc_items_create_entry
= use_doc
,
827 _doc_items_longdesc
= longdesc
,
828 drawtype
= ice_drawtype
,
829 tiles
= {"mcl_core_frosted_ice_"..i
..".png"},
830 is_ground_content
= false,
832 use_texture_alpha
= translucent_ice
,
834 groups
= {handy
=1, frosted_ice
=1, slippery
=3, not_in_creative_inventory
=1},
836 sounds
= mcl_sounds
.node_sound_glass_defaults(),
837 on_construct
= function(pos
)
838 local timer
= minetest
.get_node_timer(pos
)
841 on_timer
= function(pos
, elapsed
)
842 local ice_near
= minetest
.find_nodes_in_area(
843 { x
= pos
.x
- 1, y
= pos
.y
- 1, z
= pos
.z
- 1 },
844 { x
= pos
.x
+ 1, y
= pos
.y
+ 1, z
= pos
.z
+ 1 },
845 { "group:frosted_ice" }
847 -- Check condition to increase age
848 if (#ice_near
< 4 and minetest
.get_node_light(pos
) > (11 - i
)) or math
.random(1, 3) == 1 then
849 ice
.increase_age(pos
, ice_near
, true)
851 local timer
= minetest
.get_node_timer(pos
)
854 _mcl_blast_resistance
= 0.5,
858 -- Add entry aliases for the Help
859 if minetest
.get_modpath("doc") and i
> 0 then
860 doc
.add_entry_alias("nodes", "mcl_core:frosted_ice_0", "nodes", "mcl_core:frosted_ice_"..i
)
865 local id
, desc
, longdesc
, usagehelp
, tt_help
, help
, walkable
, drawtype
, node_box
869 tt_help
= S("Stackable")
870 longdesc
= S("Top snow is a layer of snow. It melts near light sources other than the sun with a light level of 12 or higher.").."\n"..S("Top snow can be stacked and has one of 8 different height levels. At levels 2-8, top snow is collidable. Top snow drops 2-9 snowballs, depending on its height.")
871 usagehelp
= S("This block can only be placed on full solid blocks and on another top snow (which increases its height).")
874 id
= "mcl_core:snow_"..i
876 if minetest
.get_modpath("doc") then
877 doc
.add_entry_alias("nodes", "mcl_core:snow", "nodes", id
)
885 fixed
= { -0.5, -0.5, -0.5, 0.5, -0.5 + (2*i
)/16, 0.5 },
888 local on_place
= function(itemstack
, placer
, pointed_thing
)
889 -- Placement is only allowed on top of solid blocks
890 if pointed_thing
.type ~= "node" then
891 -- no interaction possible with entities
894 local def
= minetest
.registered_nodes
[minetest
.get_node(pointed_thing
.under
).name
]
895 local above
= pointed_thing
.above
896 local under
= pointed_thing
.under
897 local unode
= minetest
.get_node(under
)
899 -- Check special rightclick action of pointed node
900 if def
and def
.on_rightclick
then
901 if not placer
:get_player_control().sneak
then
902 return def
.on_rightclick(under
, unode
, placer
, itemstack
,
903 pointed_thing
) or itemstack
, false
907 -- Get position where snow would be placed
909 if minetest
.registered_nodes
[unode
.name
].buildable_to
then
914 local tnode
= minetest
.get_node(target
)
917 local g
= minetest
.get_item_group(tnode
.name
, "top_snow")
919 local itemstring
= itemstack
:get_name()
920 local itemcount
= itemstack
:get_count()
921 local fakestack
= ItemStack(itemstring
.." "..itemcount
)
922 fakestack
:set_name("mcl_core:snow_"..math
.min(8, (i
+g
)))
924 itemstack
, success
= minetest
.item_place(fakestack
, placer
, pointed_thing
)
925 minetest
.sound_play(mcl_sounds
.node_sound_snow_defaults().place
, {pos
= below
}, true)
926 itemstack
:set_name(itemstring
)
930 -- Place snow normally
931 local below
= {x
=target
.x
, y
=target
.y
-1, z
=target
.z
}
932 local bnode
= minetest
.get_node(below
)
934 if minetest
.get_item_group(bnode
.name
, "solid") == 1 then
935 minetest
.sound_play(mcl_sounds
.node_sound_snow_defaults().place
, {pos
= below
}, true)
936 return minetest
.item_place_node(itemstack
, placer
, pointed_thing
)
942 minetest
.register_node(id
, {
945 _doc_items_longdesc
= longdesc
,
946 _doc_items_usagehelp
= usagehelp
,
947 _doc_items_create_entry
= help
,
948 _doc_items_hidden
= false,
949 tiles
= {"default_snow.png"},
950 wield_image
= "default_snow.png",
951 wield_scale
= { x
=1, y
=1, z
=i
},
952 is_ground_content
= true,
954 sunlight_propagates
= true,
956 node_placement_prediction
= "", -- to prevent client flickering when stacking snow
961 on_flood
= function(pos
, oldnode
, newnode
)
962 local npos
= {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
}
963 local node
= minetest
.get_node(npos
)
964 mcl_core
.clear_snow_dirt(npos
, node
)
967 groups
= {shovely
=1, attached_node
=1,deco_block
=1, dig_by_piston
=1, snow_cover
=1, top_snow
=i
},
968 sounds
= mcl_sounds
.node_sound_snow_defaults(),
969 on_construct
= mcl_core
.on_snow_construct
,
971 after_destruct
= mcl_core
.after_snow_destruct
,
972 drop
= "mcl_throwing:snowball "..(i
+1),
973 _mcl_blast_resistance
= 0.1,
978 minetest
.register_node("mcl_core:snowblock", {
979 description
= S("Snow"),
980 _doc_items_longdesc
= S("This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold."),
981 _doc_items_hidden
= false,
982 tiles
= {"default_snow.png"},
983 is_ground_content
= true,
985 groups
= {shovely
=1, building_block
=1, snow_cover
=1},
986 sounds
= mcl_sounds
.node_sound_snow_defaults(),
987 on_construct
= mcl_core
.on_snow_construct
,
988 after_destruct
= mcl_core
.after_snow_destruct
,
989 drop
= "mcl_throwing:snowball 4",
990 _mcl_blast_resistance
= 0.2,
994 -- Add entry aliases for the Help
995 if minetest
.get_modpath("doc") then
996 doc
.add_entry_alias("nodes", "mcl_core:stone_with_redstone", "nodes", "mcl_core:stone_with_redstone_lit")
997 doc
.add_entry_alias("nodes", "mcl_core:water_source", "nodes", "mcl_core:water_flowing")
998 doc
.add_entry_alias("nodes", "mcl_core:lava_source", "nodes", "mcl_core:lava_flowing")