2021-05-29 17:12:33 +03:00
local S = minetest.get_translator ( minetest.get_current_modname ( ) )
2019-03-08 01:40:43 +03:00
2017-07-07 17:52:28 +03:00
-- Simple solid cubic nodes, most of them are the ground materials and simple building blocks
2017-02-20 08:24:04 +03:00
2019-12-19 19:42:19 +03:00
local translucent_ice = minetest.settings : get_bool ( " mcl_translucent_ice " , false )
2021-02-18 12:39:19 +03:00
local ice_drawtype , ice_texture_alpha
2019-12-19 19:42:19 +03:00
if translucent_ice then
ice_drawtype = " glasslike "
2021-02-18 12:39:19 +03:00
ice_texture_alpha = minetest.features . use_texture_alpha_string_modes and " blend " or true
2019-12-19 19:42:19 +03:00
else
ice_drawtype = " normal "
2021-02-18 12:39:19 +03:00
ice_texture_alpha = minetest.features . use_texture_alpha_string_modes and " opaque " or false
2019-12-19 19:42:19 +03:00
end
2020-11-06 15:46:52 +03:00
mcl_core.fortune_drop_ore = {
discrete_uniform_distribution = true ,
min_count = 2 ,
max_count = 1 ,
2021-05-29 17:12:33 +03:00
get_chance = function ( fortune_level ) return 1 - 2 / ( fortune_level + 2 ) end ,
2020-11-06 15:46:52 +03:00
multiply = true ,
}
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone " , {
2019-03-08 01:40:43 +03:00
description = S ( " Stone " ) ,
_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. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_stone.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2017-07-06 01:03:36 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:cobble " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2021-03-28 03:32:57 +03:00
after_dig_node = function ( pos , oldnode , oldmetadata , digger )
if awards and awards.unlock and digger and digger : is_player ( ) then
awards.unlock ( digger : get_player_name ( ) , " mcl:stoneAge " )
end
end ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_coal " , {
2019-03-08 01:40:43 +03:00
description = S ( " Coal Ore " ) ,
_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. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_coal_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 1 , building_block = 1 , material_stone = 1 , xp = 1 , blast_furnace_smeltable = 1 } ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:coal_lump " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_iron " , {
2019-03-08 01:40:43 +03:00
description = S ( " Iron Ore " ) ,
_doc_items_longdesc = S ( " Some iron contained in stone, it is prety common and can be found below sea level. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_iron_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 3 , building_block = 1 , material_stone = 1 , blast_furnace_smeltable = 1 } ,
2022-07-25 06:48:20 +03:00
drop = " mcl_raw_ores:raw_iron " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2022-07-25 18:38:00 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_gold " , {
2019-03-08 01:40:43 +03:00
description = S ( " Gold Ore " ) ,
_doc_items_longdesc = S ( " This stone contains pure gold, a rare metal. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_gold_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 4 , building_block = 1 , material_stone = 1 , blast_furnace_smeltable = 1 } ,
2022-07-25 06:48:20 +03:00
drop = " mcl_raw_ores:raw_gold " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2022-07-25 18:38:00 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-01-04 12:27:12 +03:00
local redstone_timer = 68.28
2022-10-22 02:05:53 +03:00
local function redstone_ore_activate ( pos , node , puncher , pointed_thing )
2017-02-01 01:32:56 +03:00
minetest.swap_node ( pos , { name = " mcl_core:stone_with_redstone_lit " } )
2017-01-13 01:58:42 +03:00
local t = minetest.get_node_timer ( pos )
t : start ( redstone_timer )
2022-10-22 02:05:53 +03:00
if puncher and pointed_thing then
return minetest.node_punch ( pos , node , puncher , pointed_thing )
end
2017-01-13 01:58:42 +03:00
end
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_redstone " , {
2019-03-08 01:40:43 +03:00
description = S ( " Redstone Ore " ) ,
_doc_items_longdesc = S ( " Redstone ore is commonly found near the bottom of the world. It glows when it is punched or walked upon. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_redstone_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 4 , building_block = 1 , material_stone = 1 , xp = 7 , blast_furnace_smeltable = 1 } ,
2017-01-04 10:01:40 +03:00
drop = {
items = {
max_items = 1 ,
{
2017-01-09 20:45:34 +03:00
items = { " mesecons:redstone 4 " } ,
2017-01-04 10:01:40 +03:00
rarity = 2 ,
} ,
{
2017-01-09 20:45:34 +03:00
items = { " mesecons:redstone 5 " } ,
2017-01-04 10:01:40 +03:00
} ,
}
} ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-01-13 01:58:42 +03:00
on_punch = redstone_ore_activate ,
on_walk_over = redstone_ore_activate , -- Uses walkover mod
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = {
discrete_uniform_distribution = true ,
items = { " mesecons:redstone " } ,
min_count = 4 ,
max_count = 5 ,
}
2017-01-04 12:27:12 +03:00
} )
2022-10-22 02:05:53 +03:00
local function redstone_ore_reactivate ( pos , node , puncher , pointed_thing )
2017-01-13 01:58:42 +03:00
local t = minetest.get_node_timer ( pos )
t : start ( redstone_timer )
2022-10-22 02:05:53 +03:00
if puncher and pointed_thing then
return minetest.node_punch ( pos , node , puncher , pointed_thing )
end
2017-01-13 01:58:42 +03:00
end
2017-01-04 12:27:12 +03:00
-- Light the redstone ore up when it has been touched
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_redstone_lit " , {
2019-03-08 01:40:43 +03:00
description = S ( " Lit Redstone Ore " ) ,
2017-03-02 21:53:53 +03:00
_doc_items_create_entry = false ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_redstone_ore.png " } ,
2017-01-04 12:27:12 +03:00
paramtype = " light " ,
2017-02-02 00:12:08 +03:00
light_source = 9 ,
2017-01-04 12:27:12 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 4 , not_in_creative_inventory = 1 , material_stone = 1 , xp = 7 , blast_furnace_smeltable = 1 } ,
2017-01-04 12:27:12 +03:00
drop = {
items = {
max_items = 1 ,
{
2017-01-09 20:45:34 +03:00
items = { " mesecons:redstone 4 " } ,
2017-01-04 12:27:12 +03:00
rarity = 2 ,
} ,
{
2017-01-09 20:45:34 +03:00
items = { " mesecons:redstone 5 " } ,
2017-01-04 12:27:12 +03:00
} ,
}
} ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-01-13 01:58:42 +03:00
-- Reset timer after re-punching or stepping on
on_punch = redstone_ore_reactivate ,
on_walk_over = redstone_ore_reactivate , -- Uses walkover mod
2017-01-04 12:27:12 +03:00
-- Turn back to normal node after some time has passed
on_timer = function ( pos , elapsed )
2017-02-01 01:32:56 +03:00
minetest.swap_node ( pos , { name = " mcl_core:stone_with_redstone " } )
2017-01-04 12:27:12 +03:00
end ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-06 15:46:52 +03:00
_mcl_silk_touch_drop = { " mcl_core:stone_with_redstone " } ,
_mcl_fortune_drop = {
discrete_uniform_distribution = true ,
items = { " mesecons:redstone " } ,
min_count = 4 ,
max_count = 5 ,
}
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_lapis " , {
2019-03-08 01:40:43 +03:00
description = S ( " Lapis Lazuli Ore " ) ,
_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. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_lapis_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 3 , building_block = 1 , material_stone = 1 , xp = 6 , blast_furnace_smeltable = 1 } ,
2015-06-29 20:55:56 +03:00
drop = {
2017-01-04 10:01:40 +03:00
max_items = 1 ,
2015-06-29 20:55:56 +03:00
items = {
2022-12-22 20:10:59 +03:00
{ items = { " mcl_core:lapis 8 " } , rarity = 5 } ,
{ items = { " mcl_core:lapis 7 " } , rarity = 5 } ,
{ items = { " mcl_core:lapis 6 " } , rarity = 5 } ,
{ items = { " mcl_core:lapis 5 " } , rarity = 5 } ,
{ items = { " mcl_core:lapis 4 " } } ,
2015-06-29 20:55:56 +03:00
}
} ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2021-01-24 18:29:24 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_emerald " , {
2019-03-08 01:40:43 +03:00
description = S ( " Emerald Ore " ) ,
_doc_items_longdesc = S ( " Emerald ore is the ore of emeralds. It is very rare and can be found alone, not in clusters. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_emerald_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 4 , building_block = 1 , material_stone = 1 , xp = 6 , blast_furnace_smeltable = 1 } ,
2017-02-01 01:32:56 +03:00
drop = " mcl_core:emerald " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stone_with_diamond " , {
2019-03-08 01:40:43 +03:00
description = S ( " Diamond Ore " ) ,
_doc_items_longdesc = S ( " Diamond ore is rare and can be found in clusters near the bottom of the world. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_diamond_ore.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-05-17 19:34:44 +03:00
groups = { pickaxey = 4 , building_block = 1 , material_stone = 1 , xp = 4 , blast_furnace_smeltable = 1 } ,
2017-02-01 01:32:56 +03:00
drop = " mcl_core:diamond " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = mcl_core.fortune_drop_ore ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stonebrick " , {
2019-03-08 01:40:43 +03:00
description = S ( " Stone Bricks " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2015-06-29 20:55:56 +03:00
tiles = { " default_stone_brick.png " } ,
stack_max = 64 ,
2017-07-06 01:03:36 +03:00
groups = { pickaxey = 1 , stone = 1 , stonebrick = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stonebrickcarved " , {
2019-03-08 01:40:43 +03:00
description = S ( " Chiseled Stone Bricks " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_stonebrick_carved.png " } ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-07-06 01:03:36 +03:00
groups = { pickaxey = 1 , stone = 1 , stonebrick = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stonebrickcracked " , {
2019-03-08 01:40:43 +03:00
description = S ( " Cracked Stone Bricks " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_stonebrick_cracked.png " } ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-07-06 01:03:36 +03:00
groups = { pickaxey = 1 , stone = 1 , stonebrick = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:stonebrickmossy " , {
2019-03-08 01:40:43 +03:00
description = S ( " Mossy Stone Bricks " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_stonebrick_mossy.png " } ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-07-06 01:03:36 +03:00
groups = { pickaxey = 1 , stone = 1 , stonebrick = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-11-23 01:42:39 +03:00
minetest.register_node ( " mcl_core:stone_smooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Polished Stone " ) ,
2017-11-23 01:42:39 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
tiles = { " mcl_stairs_stone_slab_top.png " } ,
stack_max = 64 ,
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
is_ground_content = false ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-11-23 01:42:39 +03:00
_mcl_hardness = 1.5 ,
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:granite " , {
2019-03-08 01:40:43 +03:00
description = S ( " Granite " ) ,
2019-03-25 13:01:52 +03:00
_doc_items_longdesc = S ( " Granite is an igneous rock. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_granite.png " } ,
2017-01-08 03:59:50 +03:00
is_ground_content = true ,
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:granite_smooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Polished Granite " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Polished granite is a decorative building block made from granite. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_granite_smooth.png " } ,
2017-01-08 03:59:50 +03:00
stack_max = 64 ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:andesite " , {
2019-03-08 01:40:43 +03:00
description = S ( " Andesite " ) ,
_doc_items_longdesc = S ( " Andesite is an igneous rock. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_andesite.png " } ,
2017-01-08 03:59:50 +03:00
is_ground_content = true ,
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:andesite_smooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Polished Andesite " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Polished andesite is a decorative building block made from andesite. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_andesite_smooth.png " } ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2017-01-08 03:59:50 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-07-11 00:21:11 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:diorite " , {
2019-03-08 01:40:43 +03:00
description = S ( " Diorite " ) ,
_doc_items_longdesc = S ( " Diorite is an igneous rock. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_diorite.png " } ,
2017-01-08 03:59:50 +03:00
is_ground_content = true ,
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:diorite_smooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Polished Diorite " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Polished diorite is a decorative building block made from diorite. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_diorite_smooth.png " } ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2017-01-08 03:59:50 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , stone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 1.5 ,
2017-01-08 03:59:50 +03:00
} )
2017-11-15 01:44:53 +03:00
-- Grass Block
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:dirt_with_grass " , {
2019-03-08 01:40:43 +03:00
description = S ( " Grass Block " ) ,
_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. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2019-12-13 16:03:12 +03:00
paramtype2 = " color " ,
2022-11-19 14:28:31 +03:00
tiles = { " mcl_core_grass_block_top.png " , { name = " default_dirt.png " , color = " white " } , { name = " default_dirt.png^mcl_dirt_grass_shadow.png " , color = " white " } } ,
2019-12-13 16:03:12 +03:00
overlay_tiles = { " mcl_core_grass_block_top.png " , " " , { name = " mcl_core_grass_block_side_overlay.png " , tileable_vertical = false } } ,
palette = " mcl_core_palette_grass.png " ,
palette_index = 0 ,
2022-12-28 00:19:33 +03:00
color = " #7CBD6B " ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
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 ,
2021-09-08 15:34:58 +03:00
compostability = 30 , path_creation_possible = 1
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
} ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:dirt " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( {
2020-12-08 18:56:27 +03:00
footstep = { name = " default_grass_footstep " , gain = 0.1 } ,
2015-06-29 20:55:56 +03:00
} ) ,
2017-11-15 05:47:08 +03:00
on_construct = function ( pos )
2019-12-13 16:18:35 +03:00
local node = minetest.get_node ( pos )
if node.param2 == 0 then
local new_node = mcl_core.get_grass_block_type ( pos )
if new_node.param2 ~= 0 or new_node.name ~= " mcl_core:dirt_with_grass " then
minetest.set_node ( pos , new_node )
end
2017-11-15 05:47:08 +03:00
end
return mcl_core.on_snowable_construct ( pos )
end ,
2017-09-06 20:46:51 +03:00
_mcl_snowed = " mcl_core:dirt_with_grass_snow " ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 0.6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.6 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2015-06-29 20:55:56 +03:00
} )
2021-01-04 12:09:44 +03:00
mcl_core.register_snowed_node ( " mcl_core:dirt_with_grass_snow " , " mcl_core:dirt_with_grass " , nil , nil , true , S ( " Dirt with Snow " ) )
2017-11-15 01:44:53 +03:00
2017-02-06 21:25:15 +03:00
minetest.register_node ( " mcl_core:grass_path " , {
2017-07-08 19:08:02 +03:00
tiles = { " mcl_core_grass_path_top.png " , " default_dirt.png " , " mcl_core_grass_path_side.png " } ,
2019-03-08 01:40:43 +03:00
description = S ( " Grass Path " ) ,
2019-03-09 19:01:36 +03:00
_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. " ) ,
2017-02-06 21:25:15 +03:00
drop = " mcl_core:dirt " ,
is_ground_content = true ,
2021-02-18 16:00:17 +03:00
use_texture_alpha = minetest.features . use_texture_alpha_string_modes and " opaque " or false ,
2017-02-06 21:25:15 +03:00
drawtype = " nodebox " ,
paramtype = " light " ,
node_box = {
type = " fixed " ,
fixed = {
-- 15/16 of the normal height
{ - 0.5 , - 0.5 , - 0.5 , 0.5 , 0.4375 , 0.5 } ,
}
} ,
2017-11-23 02:32:51 +03:00
groups = { handy = 1 , shovely = 1 , cultivatable = 2 , dirtifies_below_solid = 1 , dirtifier = 1 , deco_block = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( {
2020-12-08 18:56:27 +03:00
footstep = { name = " default_grass_footstep " , gain = 0.1 } ,
2017-02-06 21:29:11 +03:00
} ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.65 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.6 ,
2017-02-06 21:25:15 +03:00
} )
2017-01-10 06:24:42 +03:00
-- TODO: Add particles
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:mycelium " , {
2019-03-08 01:40:43 +03:00
description = S ( " Mycelium " ) ,
_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. " ) ,
2019-02-09 23:28:53 +03:00
tiles = { " mcl_core_mycelium_top.png " , " default_dirt.png " , { name = " mcl_core_mycelium_side.png " , tileable_vertical = false } } ,
2017-01-10 05:54:15 +03:00
is_ground_content = true ,
stack_max = 64 ,
2022-11-14 00:41:28 +03:00
groups = { handy = 1 , shovely = 1 , dirt = 2 , spreading_dirt_type = 1 , enderman_takable = 1 , building_block = 1 , soil_sapling = 2 , path_creation_possible = 1 , mycelium = 1 } ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:dirt " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( {
2020-12-08 18:56:27 +03:00
footstep = { name = " default_grass_footstep " , gain = 0.1 } ,
2017-01-10 05:54:15 +03:00
} ) ,
2017-09-06 20:46:51 +03:00
2017-09-06 20:33:39 +03:00
on_construct = mcl_core.on_snowable_construct ,
2017-09-06 20:46:51 +03:00
_mcl_snowed = " mcl_core:mycelium_snow " ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 0.6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.6 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2017-01-10 05:54:15 +03:00
} )
2021-01-04 12:09:44 +03:00
mcl_core.register_snowed_node ( " mcl_core:mycelium_snow " , " mcl_core:mycelium " , nil , nil , false , S ( " Mycelium with Snow " ) )
2017-04-01 07:44:02 +03:00
2022-11-14 01:22:00 +03:00
local PARTICLE_ABM_DISTANCE = 16
2022-11-14 00:41:28 +03:00
--if minetest.settings:get("mcl_node_particles") == "full" then
minetest.register_abm ( {
label = " Townaura particles " ,
nodenames = { " group:mycelium " } ,
2022-11-14 01:22:00 +03:00
interval = 2 ,
2022-11-14 00:41:28 +03:00
chance = 30 ,
action = function ( pos , node )
2022-11-14 01:22:00 +03:00
local player_near = false
for _ , player in pairs ( minetest.get_connected_players ( ) ) do
if vector.distance ( player : get_pos ( ) , pos ) < PARTICLE_ABM_DISTANCE then
player_near = true
end
end
if player_near then
local apos = { x = pos.x - 2 , y = pos.y + 0.51 , z = pos.z - 2 }
local apos2 = { x = pos.x + 2 , y = pos.y + 0.51 , z = pos.z + 2 }
local acc = { x = 0 , y = 0 , z = 0 }
minetest.add_particlespawner ( {
time = 2 ,
amount = 5 ,
minpos = apos ,
maxpos = apos2 ,
minvel = vector.new ( - 3 / 10 , 0 , - 3 / 10 ) ,
maxvel = vector.new ( 3 / 10 , 10 / 60 , 3 / 10 ) ,
minacc = acc ,
expirationtime = 4 ,
collisiondetection = true ,
collision_removal = true ,
size = 1 ,
texture = " mcl_core_mycelium_particle.png " ,
} )
end
2022-11-14 00:41:28 +03:00
end ,
} )
--end
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:podzol " , {
2019-03-08 01:40:43 +03:00
description = S ( " Podzol " ) ,
_doc_items_longdesc = S ( " Podzol is a type of dirt found in taiga forests. Only a few plants are able to survive on it. " ) ,
2019-02-09 23:28:53 +03:00
tiles = { " mcl_core_dirt_podzol_top.png " , " default_dirt.png " , { name = " mcl_core_dirt_podzol_side.png " , tileable_vertical = false } } ,
2017-01-10 06:24:42 +03:00
is_ground_content = true ,
stack_max = 64 ,
2021-09-08 15:34:58 +03:00
groups = { handy = 1 , shovely = 3 , dirt = 2 , soil = 1 , soil_sapling = 2 , soil_sugarcane = 1 , enderman_takable = 1 , building_block = 1 , path_creation_possible = 1 } ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:dirt " ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( ) ,
2017-09-06 20:33:39 +03:00
on_construct = mcl_core.on_snowable_construct ,
2017-09-06 20:46:51 +03:00
_mcl_snowed = " mcl_core:podzol_snow " ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 0.8 ,
_mcl_hardness = 0.8 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2017-01-10 06:24:42 +03:00
} )
2021-01-04 12:09:44 +03:00
mcl_core.register_snowed_node ( " mcl_core:podzol_snow " , " mcl_core:podzol " , nil , nil , false , S ( " Podzol with Snow " ) )
2017-04-01 07:44:02 +03:00
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:dirt " , {
2019-03-08 01:40:43 +03:00
description = S ( " Dirt " ) ,
_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. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_dirt.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2021-09-08 15:34:58 +03:00
groups = { handy = 1 , shovely = 1 , dirt = 1 , soil = 1 , soil_sapling = 2 , soil_sugarcane = 1 , cultivatable = 2 , enderman_takable = 1 , building_block = 1 , path_creation_possible = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:coarse_dirt " , {
2019-03-08 01:40:43 +03:00
description = S ( " Coarse Dirt " ) ,
_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. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_coarse_dirt.png " } ,
2017-01-05 03:28:43 +03:00
is_ground_content = true ,
stack_max = 64 ,
2021-09-08 15:34:58 +03:00
groups = { handy = 1 , shovely = 1 , dirt = 3 , soil = 1 , soil_sugarcane = 1 , cultivatable = 1 , enderman_takable = 1 , building_block = 1 , soil_sapling = 2 , path_creation_possible = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2017-01-05 03:28:43 +03:00
} )
2015-06-29 20:55:56 +03:00
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:gravel " , {
2019-03-08 01:40:43 +03:00
description = S ( " Gravel " ) ,
_doc_items_longdesc = S ( " This block consists of a couple of loose stones and can't support itself. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_gravel.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2017-07-05 21:14:37 +03:00
groups = { handy = 1 , shovely = 1 , falling_node = 1 , enderman_takable = 1 , building_block = 1 , material_sand = 1 } ,
2015-06-29 20:55:56 +03:00
drop = {
max_items = 1 ,
items = {
2021-05-29 17:12:33 +03:00
{ items = { " mcl_core:flint " } , rarity = 10 } ,
{ items = { " mcl_core:gravel " } }
2015-06-29 20:55:56 +03:00
}
} ,
2022-12-20 22:57:57 +03:00
sounds = mcl_sounds.node_sound_gravel_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.6 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2020-11-06 15:46:52 +03:00
_mcl_fortune_drop = {
[ 1 ] = {
max_items = 1 ,
items = {
2021-05-29 17:12:33 +03:00
{ items = { " mcl_core:flint " } , rarity = 7 } ,
{ items = { " mcl_core:gravel " } }
2020-11-06 15:46:52 +03:00
}
} ,
[ 2 ] = {
max_items = 1 ,
items = {
2021-05-29 17:12:33 +03:00
{ items = { " mcl_core:flint " } , rarity = 4 } ,
{ items = { " mcl_core:gravel " } }
2020-11-06 15:46:52 +03:00
}
} ,
2021-01-04 12:15:28 +03:00
[ 3 ] = " mcl_core:flint " ,
2020-11-06 15:46:52 +03:00
} ,
2015-06-29 20:55:56 +03:00
} )
-- sandstone --
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:sand " , {
2019-03-08 01:40:43 +03:00
description = S ( " Sand " ) ,
_doc_items_longdesc = S ( " Sand is found in large quantities at beaches and deserts. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_sand.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2017-07-05 21:14:37 +03:00
groups = { handy = 1 , shovely = 1 , falling_node = 1 , sand = 1 , soil_sugarcane = 1 , enderman_takable = 1 , building_block = 1 , material_sand = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_sand_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:sandstone " , {
2019-03-08 01:40:43 +03:00
description = S ( " Sandstone " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2019-03-08 01:40:43 +03:00
_doc_items_longdesc = S ( " Sandstone is compressed sand and is a rather soft kind of stone. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_sandstone_top.png " , " mcl_core_sandstone_bottom.png " , " mcl_core_sandstone_normal.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , normal_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.8 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:sandstonesmooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Cut Sandstone " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Cut sandstone is a decorative building block. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_sandstone_top.png " , " mcl_core_sandstone_bottom.png " , " mcl_core_sandstone_smooth.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , normal_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 6 ,
_mcl_hardness = 2 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:sandstonecarved " , {
2019-03-08 01:40:43 +03:00
description = S ( " Chiseled Sandstone " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Chiseled sandstone is a decorative building block. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_sandstone_top.png " , " mcl_core_sandstone_bottom.png " , " mcl_core_sandstone_carved.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , normal_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.8 ,
2015-06-29 20:55:56 +03:00
} )
2017-11-23 01:42:39 +03:00
minetest.register_node ( " mcl_core:sandstonesmooth2 " , {
2019-03-08 01:40:43 +03:00
description = S ( " Smooth Sandstone " ) ,
2017-11-23 01:42:39 +03:00
_doc_items_hidden = false ,
2019-03-08 01:40:43 +03:00
_doc_items_longdesc = S ( " Smooth sandstone is compressed sand and is a rather soft kind of stone. " ) ,
2017-11-23 01:42:39 +03:00
tiles = { " mcl_core_sandstone_top.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2017-11-23 01:42:39 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , normal_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-11-23 01:42:39 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 6 ,
_mcl_hardness = 2 ,
2017-11-23 01:42:39 +03:00
} )
2015-06-29 20:55:56 +03:00
-- red sandstone --
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:redsand " , {
2019-03-08 01:40:43 +03:00
description = S ( " Red Sand " ) ,
_doc_items_longdesc = S ( " Red sand is found in large quantities in mesa biomes. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_red_sand.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2017-07-05 21:14:37 +03:00
groups = { handy = 1 , shovely = 1 , falling_node = 1 , sand = 1 , soil_sugarcane = 1 , enderman_takable = 1 , building_block = 1 , material_sand = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_sand_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:redsandstone " , {
2019-03-08 01:40:43 +03:00
description = S ( " Red Sandstone " ) ,
_doc_items_longdesc = S ( " Red sandstone is compressed red sand and is a rather soft kind of stone. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_red_sandstone_top.png " , " mcl_core_red_sandstone_bottom.png " , " mcl_core_red_sandstone_normal.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , red_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.8 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:redsandstonesmooth " , {
2019-03-08 01:40:43 +03:00
description = S ( " Cut Red Sandstone " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Cut red sandstone is a decorative building block. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_red_sandstone_top.png " , " mcl_core_red_sandstone_bottom.png " , " mcl_core_red_sandstone_smooth.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , red_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.8 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:redsandstonecarved " , {
2019-03-08 01:40:43 +03:00
description = S ( " Chiseled Red Sandstone " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Chiseled red sandstone is a decorative building block. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_red_sandstone_top.png " , " mcl_core_red_sandstone_bottom.png " , " mcl_core_red_sandstone_carved.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , red_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.8 ,
2015-06-29 20:55:56 +03:00
} )
2017-11-23 01:42:39 +03:00
minetest.register_node ( " mcl_core:redsandstonesmooth2 " , {
2019-03-08 01:40:43 +03:00
description = S ( " Smooth Red Sandstone " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " Smooth red sandstone is a decorative building block. " ) ,
2017-11-23 01:42:39 +03:00
tiles = { " mcl_core_red_sandstone_top.png " } ,
2018-01-31 21:36:27 +03:00
is_ground_content = false ,
2017-11-23 01:42:39 +03:00
stack_max = 64 ,
2019-03-12 03:49:27 +03:00
groups = { pickaxey = 1 , sandstone = 1 , red_sandstone = 1 , building_block = 1 , material_stone = 1 } ,
2017-11-23 01:42:39 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.8 ,
2017-11-23 01:42:39 +03:00
_mcl_hardness = 0.8 ,
} )
2015-06-29 20:55:56 +03:00
---
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:clay " , {
2019-03-08 01:40:43 +03:00
description = S ( " Clay " ) ,
_doc_items_longdesc = S ( " Clay is a versatile kind of earth commonly found at beaches underwater. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_clay.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2017-07-05 21:14:37 +03:00
groups = { handy = 1 , shovely = 1 , enderman_takable = 1 , building_block = 1 } ,
2021-05-29 17:12:33 +03:00
drop = " mcl_core:clay_lump 4 " ,
2017-05-23 00:23:53 +03:00
sounds = mcl_sounds.node_sound_dirt_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.6 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 20:51:26 +03:00
minetest.register_node ( " mcl_core:brick_block " , {
-- Original name: “Bricks”
2019-03-08 01:40:43 +03:00
description = S ( " Brick Block " ) ,
_doc_items_longdesc = S ( " Brick blocks are a good building material for building solid houses and can take quite a punch. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_brick.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 2 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:bedrock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Bedrock " ) ,
_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 " ..
S ( " In the End dimension, starting a fire on this block will create an eternal fire. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_bedrock.png " } ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { creative_breakable = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2017-01-04 11:42:25 +03:00
is_ground_content = false ,
on_blast = function ( ) end ,
2021-05-29 17:12:33 +03:00
drop = " " ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3600000 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = - 1 ,
2017-11-11 21:52:11 +03:00
-- Eternal fire on top of bedrock, if in the End dimension
after_destruct = function ( pos )
pos.y = pos.y + 1
if minetest.get_node ( pos ) . name == " mcl_fire:eternal_fire " then
minetest.remove_node ( pos )
end
end ,
_on_ignite = function ( player , pointed_thing )
local pos = pointed_thing.under
2017-11-24 05:10:02 +03:00
local dim = mcl_worlds.pos_to_dimension ( pos )
2017-11-11 21:52:11 +03:00
local flame_pos = { x = pos.x , y = pos.y + 1 , z = pos.z }
local fn = minetest.get_node ( flame_pos )
2019-02-11 23:27:17 +03:00
local pname = player : get_player_name ( )
if minetest.is_protected ( flame_pos , pname ) then
return minetest.record_protection_violation ( flame_pos , pname )
end
if dim == " end " and fn.name == " air " and pointed_thing.under . y < pointed_thing.above . y then
2017-11-11 21:52:11 +03:00
minetest.set_node ( flame_pos , { name = " mcl_fire:eternal_fire " } )
return true
else
return false
end
end ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:cobble " , {
2019-03-08 01:40:43 +03:00
description = S ( " Cobblestone " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_cobble.png " } ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2022-05-04 16:14:23 +03:00
groups = { pickaxey = 1 , building_block = 1 , material_stone = 1 , cobble = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 2 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:mossycobble " , {
2019-12-11 06:23:26 +03:00
description = S ( " Mossy Cobblestone " ) ,
2017-03-18 20:01:28 +03:00
_doc_items_longdesc = doc.sub . items.temp . build ,
2015-06-29 20:55:56 +03:00
tiles = { " default_mossycobble.png " } ,
2017-03-11 18:36:05 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 1 , building_block = 1 , material_stone = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 2 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:coalblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Block of Coal " ) ,
_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. " ) ,
2017-01-04 13:44:55 +03:00
tiles = { " default_coal_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2017-01-04 13:44:55 +03:00
stack_max = 64 ,
2020-04-19 00:24:42 +03:00
groups = { pickaxey = 1 , flammable = 1 , building_block = 1 , material_stone = 1 , fire_encouragement = 5 , fire_flammability = 5 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 5 ,
2017-01-04 13:44:55 +03:00
} )
2017-02-11 23:14:40 +03:00
minetest.register_node ( " mcl_core:ironblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Block of Iron " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " A block of iron is mostly a decorative block but also useful as a compact storage of iron ingots. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_steel_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-02-25 18:19:24 +03:00
groups = { pickaxey = 2 , building_block = 1 } ,
2017-06-06 22:10:24 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:goldblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Block of Gold " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " A block of gold is mostly a shiny decorative block but also useful as a compact storage of gold ingots. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_gold_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-02-25 18:19:24 +03:00
groups = { pickaxey = 4 , building_block = 1 } ,
2017-06-06 22:10:24 +03:00
sounds = mcl_sounds.node_sound_metal_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2022-06-12 12:30:39 +03:00
_mcl_hardness = 3 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:diamondblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Block of Diamond " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " A block of diamond is mostly a shiny decorative block but also useful as a compact storage of diamonds. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_diamond_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-02-25 18:19:24 +03:00
groups = { pickaxey = 4 , building_block = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:lapisblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Lapis Lazuli Block " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " A lapis lazuli block is mostly a decorative block but also useful as a compact storage of lapis lazuli. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_lapis_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-02-25 18:19:24 +03:00
groups = { pickaxey = 3 , building_block = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 3 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 3 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:emeraldblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Block of Emerald " ) ,
2019-03-09 19:01:36 +03:00
_doc_items_longdesc = S ( " A block of emerald is mostly a shiny decorative block but also useful as a compact storage of emeralds. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_emerald_block.png " } ,
2017-01-05 00:36:51 +03:00
is_ground_content = false ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-02-25 18:19:24 +03:00
groups = { pickaxey = 4 , building_block = 1 } ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 6 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 5 ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:obsidian " , {
2019-03-08 01:40:43 +03:00
description = S ( " Obsidian " ) ,
_doc_items_longdesc = S ( " Obsidian is an extremely hard mineral with an enourmous blast-resistance. Obsidian is formed when water meets lava. " ) ,
2015-06-29 20:55:56 +03:00
tiles = { " default_obsidian.png " } ,
2021-03-26 08:29:05 +03:00
is_ground_content = false ,
2017-02-11 20:46:23 +03:00
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2017-03-11 07:34:58 +03:00
groups = { pickaxey = 5 , building_block = 1 , material_stone = 1 } ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 1200 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 50 ,
2021-03-28 03:32:57 +03:00
after_dig_node = function ( pos , oldnode , oldmetadata , digger )
if awards and awards.unlock and digger and digger : is_player ( ) then
awards.unlock ( digger : get_player_name ( ) , " mcl:obsidian " )
end
end ,
2015-06-29 20:55:56 +03:00
} )
2022-06-30 02:43:22 +03:00
minetest.register_node ( " mcl_core:crying_obsidian " , {
description = S ( " Crying Obsidian " ) ,
_doc_items_longdesc = S ( " Crying obsidian is a luminous obsidian that can generate as part of ruined portals. " ) ,
tiles = { " default_obsidian.png^mcl_core_crying_obsidian.png " } ,
is_ground_content = false ,
light_source = 10 ,
sounds = mcl_sounds.node_sound_stone_defaults ( ) ,
stack_max = 64 ,
groups = { pickaxey = 5 , building_block = 1 , material_stone = 1 } ,
_mcl_blast_resistance = 1200 ,
_mcl_hardness = 50 ,
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:ice " , {
2019-03-08 01:40:43 +03:00
description = S ( " Ice " ) ,
2019-12-19 19:42:19 +03:00
_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. " ) ,
drawtype = ice_drawtype ,
2015-06-29 20:55:56 +03:00
tiles = { " default_ice.png " } ,
is_ground_content = true ,
paramtype = " light " ,
2021-02-18 12:39:19 +03:00
use_texture_alpha = ice_texture_alpha ,
2015-06-29 20:55:56 +03:00
stack_max = 64 ,
2021-02-03 19:08:04 +03:00
groups = { handy = 1 , pickaxey = 1 , slippery = 3 , building_block = 1 , ice = 1 } ,
2017-01-04 10:01:40 +03:00
drop = " " ,
2022-12-20 22:57:57 +03:00
sounds = mcl_sounds.node_sound_ice_defaults ( ) ,
2019-03-08 06:42:24 +03:00
node_dig_prediction = " mcl_core:water_source " ,
2019-02-22 08:13:31 +03:00
after_dig_node = function ( pos , oldnode )
2019-06-02 11:12:36 +03:00
mcl_core.melt_ice ( pos )
2017-07-08 19:34:56 +03:00
end ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2015-06-29 20:55:56 +03:00
} )
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:packed_ice " , {
2019-03-08 01:40:43 +03:00
description = S ( " Packed Ice " ) ,
_doc_items_longdesc = S ( " Packed ice is a compressed form of ice. It is opaque and solid. " ) ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_ice_packed.png " } ,
2015-06-29 20:55:56 +03:00
is_ground_content = true ,
stack_max = 64 ,
2021-02-03 19:08:04 +03:00
groups = { handy = 1 , pickaxey = 1 , slippery = 3 , building_block = 1 , ice = 1 } ,
2017-01-04 10:01:40 +03:00
drop = " " ,
2022-12-20 22:57:57 +03:00
sounds = mcl_sounds.node_sound_ice_defaults ( ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2015-06-29 20:55:56 +03:00
} )
2017-01-08 04:49:07 +03:00
-- Frosted Ice (4 nodes)
for i = 0 , 3 do
local ice = { }
2021-05-26 20:51:24 +03:00
function ice . increase_age ( pos , ice_near , first_melt )
2017-01-08 04:49:07 +03:00
-- Increase age of frosted age or turn to water source if too old
local nn = minetest.get_node ( pos ) . name
local age = tonumber ( string.sub ( nn , - 1 ) )
2017-11-24 05:10:02 +03:00
local dim = mcl_worlds.pos_to_dimension ( pos )
2017-01-08 04:49:07 +03:00
if age == nil then return end
if age < 3 then
2017-08-21 20:12:37 +03:00
minetest.swap_node ( pos , { name = " mcl_core:frosted_ice_ " .. ( age + 1 ) } )
2017-01-08 04:49:07 +03:00
else
2017-08-21 20:12:37 +03:00
if dim ~= " nether " then
minetest.set_node ( pos , { name = " mcl_core:water_source " } )
else
minetest.remove_node ( pos )
end
2017-01-08 04:49:07 +03:00
end
-- Spread aging to neighbor blocks, but not recursively
if first_melt and i == 3 then
for j = 1 , # ice_near do
ice.increase_age ( ice_near [ j ] , false )
end
end
end
2017-03-20 20:12:05 +03:00
local use_doc = i == 0
2017-03-11 19:32:39 +03:00
local longdesc
2017-03-20 20:12:05 +03:00
if use_doc then
2019-12-19 19:42:19 +03:00
longdesc = S ( " Frosted ice is a short-lived solid block. It melts into a water source within a few seconds. " )
2017-03-11 19:32:39 +03:00
end
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:frosted_ice_ " .. i , {
2019-03-08 01:40:43 +03:00
description = S ( " Frosted Ice " ) ,
2017-03-20 20:12:05 +03:00
_doc_items_create_entry = use_doc ,
2017-03-11 19:32:39 +03:00
_doc_items_longdesc = longdesc ,
2019-12-19 19:42:19 +03:00
drawtype = ice_drawtype ,
2017-05-26 02:06:54 +03:00
tiles = { " mcl_core_frosted_ice_ " .. i .. " .png " } ,
2017-01-08 04:49:07 +03:00
is_ground_content = false ,
paramtype = " light " ,
2021-02-18 12:39:19 +03:00
use_texture_alpha = ice_texture_alpha ,
2017-01-08 04:49:07 +03:00
stack_max = 64 ,
2021-02-03 19:08:04 +03:00
groups = { handy = 1 , frosted_ice = 1 , slippery = 3 , not_in_creative_inventory = 1 , ice = 1 } ,
2017-01-08 04:49:07 +03:00
drop = " " ,
2022-12-20 22:57:57 +03:00
sounds = mcl_sounds.node_sound_ice_defaults ( ) ,
2017-01-08 04:49:07 +03:00
on_construct = function ( pos )
local timer = minetest.get_node_timer ( pos )
timer : start ( 1.5 )
end ,
on_timer = function ( pos , elapsed )
local ice_near = minetest.find_nodes_in_area (
{ x = pos.x - 1 , y = pos.y - 1 , z = pos.z - 1 } ,
{ x = pos.x + 1 , y = pos.y + 1 , z = pos.z + 1 } ,
{ " group:frosted_ice " }
)
-- Check condition to increase age
if ( # ice_near < 4 and minetest.get_node_light ( pos ) > ( 11 - i ) ) or math.random ( 1 , 3 ) == 1 then
ice.increase_age ( pos , ice_near , true )
end
local timer = minetest.get_node_timer ( pos )
timer : start ( 1.5 )
end ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.5 ,
2017-02-24 17:56:46 +03:00
_mcl_hardness = 0.5 ,
2017-01-08 04:49:07 +03:00
} )
2017-03-20 20:12:05 +03:00
-- Add entry aliases for the Help
if minetest.get_modpath ( " doc " ) and i > 0 then
doc.add_entry_alias ( " nodes " , " mcl_core:frosted_ice_0 " , " nodes " , " mcl_core:frosted_ice_ " .. i )
end
2017-01-08 04:49:07 +03:00
end
2018-01-08 01:21:47 +03:00
for i = 1 , 8 do
2020-03-08 05:18:47 +03:00
local id , desc , longdesc , usagehelp , tt_help , help , walkable , drawtype , node_box
2018-01-08 01:21:47 +03:00
if i == 1 then
id = " mcl_core:snow "
2019-03-08 01:40:43 +03:00
desc = S ( " Top Snow " )
2020-03-08 05:18:47 +03:00
tt_help = S ( " Stackable " )
2019-03-25 14:05:57 +03:00
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. " )
2021-01-04 12:09:44 +03:00
usagehelp = S ( " This block can only be placed on full solid blocks and on another top snow (which increases its height). " )
2018-01-08 01:21:47 +03:00
walkable = false
else
id = " mcl_core:snow_ " .. i
help = false
if minetest.get_modpath ( " doc " ) then
doc.add_entry_alias ( " nodes " , " mcl_core:snow " , " nodes " , id )
end
walkable = true
end
2018-01-08 01:43:23 +03:00
if i ~= 8 then
drawtype = " nodebox "
node_box = {
type = " fixed " ,
fixed = { - 0.5 , - 0.5 , - 0.5 , 0.5 , - 0.5 + ( 2 * i ) / 16 , 0.5 } ,
}
end
2021-05-29 17:12:33 +03:00
local function on_place ( itemstack , placer , pointed_thing )
2018-01-07 23:34:42 +03:00
-- Placement is only allowed on top of solid blocks
if pointed_thing.type ~= " node " then
-- no interaction possible with entities
return itemstack
end
local def = minetest.registered_nodes [ minetest.get_node ( pointed_thing.under ) . name ]
local above = pointed_thing.above
local under = pointed_thing.under
local unode = minetest.get_node ( under )
2018-01-08 01:21:47 +03:00
2018-01-07 23:34:42 +03:00
-- Check special rightclick action of pointed node
if def and def.on_rightclick then
if not placer : get_player_control ( ) . sneak then
return def.on_rightclick ( under , unode , placer , itemstack ,
pointed_thing ) or itemstack , false
end
end
2018-01-08 01:21:47 +03:00
-- Get position where snow would be placed
local target
if minetest.registered_nodes [ unode.name ] . buildable_to then
target = under
2018-01-07 23:34:42 +03:00
else
2018-01-08 01:21:47 +03:00
target = above
2018-01-07 23:34:42 +03:00
end
2018-01-08 01:21:47 +03:00
local tnode = minetest.get_node ( target )
-- Stack snow
local g = minetest.get_item_group ( tnode.name , " top_snow " )
if g > 0 then
local itemstring = itemstack : get_name ( )
local itemcount = itemstack : get_count ( )
local fakestack = ItemStack ( itemstring .. " " .. itemcount )
fakestack : set_name ( " mcl_core:snow_ " .. math.min ( 8 , ( i + g ) ) )
2021-05-23 01:09:07 +03:00
itemstack = minetest.item_place ( fakestack , placer , pointed_thing )
minetest.sound_play ( mcl_sounds.node_sound_snow_defaults ( ) . place , { pos = pointed_thing.under } , true )
2018-01-08 01:21:47 +03:00
itemstack : set_name ( itemstring )
return itemstack
end
-- Place snow normally
local below = { x = target.x , y = target.y - 1 , z = target.z }
2018-01-07 23:34:42 +03:00
local bnode = minetest.get_node ( below )
2018-01-08 01:21:47 +03:00
2018-01-07 23:34:42 +03:00
if minetest.get_item_group ( bnode.name , " solid " ) == 1 then
2020-04-07 01:55:45 +03:00
minetest.sound_play ( mcl_sounds.node_sound_snow_defaults ( ) . place , { pos = below } , true )
2018-01-07 23:34:42 +03:00
return minetest.item_place_node ( itemstack , placer , pointed_thing )
else
return itemstack
end
2018-01-08 01:21:47 +03:00
end
minetest.register_node ( id , {
description = desc ,
2020-03-08 05:18:47 +03:00
_tt_help = tt_help ,
2018-01-08 01:21:47 +03:00
_doc_items_longdesc = longdesc ,
2018-01-08 01:36:05 +03:00
_doc_items_usagehelp = usagehelp ,
2018-01-23 07:19:05 +03:00
_doc_items_create_entry = help ,
2018-01-08 01:21:47 +03:00
_doc_items_hidden = false ,
tiles = { " default_snow.png " } ,
wield_image = " default_snow.png " ,
wield_scale = { x = 1 , y = 1 , z = i } ,
is_ground_content = true ,
paramtype = " light " ,
sunlight_propagates = true ,
buildable_to = true ,
node_placement_prediction = " " , -- to prevent client flickering when stacking snow
2018-01-08 01:43:23 +03:00
drawtype = drawtype ,
2018-01-08 01:21:47 +03:00
stack_max = 64 ,
walkable = walkable ,
floodable = true ,
on_flood = function ( pos , oldnode , newnode )
local npos = { x = pos.x , y = pos.y - 1 , z = pos.z }
local node = minetest.get_node ( npos )
mcl_core.clear_snow_dirt ( npos , node )
end ,
2018-01-08 01:43:23 +03:00
node_box = node_box ,
2022-08-07 12:55:01 +03:00
groups = { shovely = 2 , attached_node = 1 , deco_block = 1 , dig_by_piston = 1 , snow_cover = 1 , top_snow = i } ,
2018-01-08 01:21:47 +03:00
sounds = mcl_sounds.node_sound_snow_defaults ( ) ,
on_construct = mcl_core.on_snow_construct ,
on_place = on_place ,
after_destruct = mcl_core.after_snow_destruct ,
drop = " mcl_throwing:snowball " .. ( i + 1 ) ,
2020-04-15 14:27:29 +03:00
_mcl_blast_resistance = 0.1 ,
2018-01-08 01:21:47 +03:00
_mcl_hardness = 0.1 ,
2021-06-23 04:06:24 +03:00
_mcl_silk_touch_drop = { " mcl_core:snow " .. i } ,
2018-01-08 01:21:47 +03:00
} )
end
2015-06-29 20:55:56 +03:00
2017-02-01 01:32:56 +03:00
minetest.register_node ( " mcl_core:snowblock " , {
2019-03-08 01:40:43 +03:00
description = S ( " Snow " ) ,
_doc_items_longdesc = S ( " This is a full block of snow. Snow of this thickness is usually found in areas of extreme cold. " ) ,
2017-03-20 18:38:16 +03:00
_doc_items_hidden = false ,
2015-06-29 20:55:56 +03:00
tiles = { " default_snow.png " } ,
is_ground_content = true ,
stack_max = 64 ,
2022-08-07 12:55:01 +03:00
groups = { shovely = 2 , building_block = 1 , snow_cover = 1 } ,
2017-02-19 21:48:16 +03:00
sounds = mcl_sounds.node_sound_snow_defaults ( ) ,
2017-09-06 20:17:36 +03:00
on_construct = mcl_core.on_snow_construct ,
after_destruct = mcl_core.after_snow_destruct ,
2017-01-17 01:11:04 +03:00
drop = " mcl_throwing:snowball 4 " ,
2022-06-12 12:30:39 +03:00
_mcl_blast_resistance = 0.1 ,
_mcl_hardness = 0.1 ,
2020-11-02 21:09:23 +03:00
_mcl_silk_touch_drop = true ,
2015-06-29 20:55:56 +03:00
} )
2017-03-22 20:55:02 +03:00
-- Add entry aliases for the Help
if minetest.get_modpath ( " doc " ) then
doc.add_entry_alias ( " nodes " , " mcl_core:stone_with_redstone " , " nodes " , " mcl_core:stone_with_redstone_lit " )
doc.add_entry_alias ( " nodes " , " mcl_core:water_source " , " nodes " , " mcl_core:water_flowing " )
doc.add_entry_alias ( " nodes " , " mcl_core:lava_source " , " nodes " , " mcl_core:lava_flowing " )
end