From 105c3648f839ea57125d9c9fcdfc02d6eb0fa16f Mon Sep 17 00:00:00 2001 From: seventeenthShulker Date: Tue, 19 Sep 2023 22:02:13 +0200 Subject: [PATCH] Make monster eggs' hardness consistent with MC Change blast resistance to 0.75, add an optional hardness override parameter, because cobble is unique here (Still instant-minable, this is a separate issue) --- mods/ITEMS/mcl_monster_eggs/init.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_monster_eggs/init.lua b/mods/ITEMS/mcl_monster_eggs/init.lua index f58717d04..42db03c8f 100644 --- a/mods/ITEMS/mcl_monster_eggs/init.lua +++ b/mods/ITEMS/mcl_monster_eggs/init.lua @@ -10,10 +10,15 @@ local function spawn_silverfish(pos, oldnode, oldmetadata, digger) end -- Template function for registering monster egg blocks -local function register_block(subname, description, tiles, is_ground_content) +local function register_block(subname, description, tiles, is_ground_content, hardness_override) if is_ground_content == nil then is_ground_content = false end + -- Default hardness matches for stone and stone brick variants; cobble has 1.0 + local hardness = 0.75 + if hardness_override then + hardness = hardness_override + end minetest.register_node("mcl_monster_eggs:monster_egg_"..subname, { description = description, tiles = tiles, @@ -24,14 +29,14 @@ local function register_block(subname, description, tiles, is_ground_content) after_dig_node = spawn_silverfish, _tt_help = S("Hides a silverfish"), _doc_items_longdesc = S("An infested block is a block from which a silverfish will pop out when it is broken. It looks identical to its normal counterpart."), - _mcl_hardness = 0, - _mcl_blast_resistance = 0.5, + _mcl_hardness = hardness, + _mcl_blast_resistance = 0.75, }) end -- Register all the monster egg blocks register_block("stone", S("Infested Stone"), {"default_stone.png"}, true) -register_block("cobble", S("Infested Cobblestone"), {"default_cobble.png"}) +register_block("cobble", S("Infested Cobblestone"), {"default_cobble.png"}, nil, 1.0) register_block("stonebrick", S("Infested Stone Bricks"), {"default_stone_brick.png"}) register_block("stonebrickcracked", S("Infested Cracked Stone Bricks"), {"mcl_core_stonebrick_cracked.png"}) register_block("stonebrickmossy", S("Infested Mossy Stone Bricks"), {"mcl_core_stonebrick_mossy.png"})