From b190dda1eba724926a9212937a054d711b8ca03a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 24 May 2017 00:56:55 +0200 Subject: [PATCH] Make more blocks immune against TNT explosions --- mods/ITEMS/mcl_tnt/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index a9ded8045..63b5b61e5 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -124,7 +124,10 @@ function TNT:on_step(dtime) if x*x+y*y+z*z <= TNT_RANGE * TNT_RANGE + TNT_RANGE then local np={x=pos.x+x,y=pos.y+y,z=pos.z+z} local n = minetest.get_node(np) - if n.name ~= "air" and n.name ~= "mcl_core:obsidian" and n.name ~= "mcl_core:bedrock" and n.name ~= "protector:protect" then + local def = minetest.registered_nodes[n.name] + -- Simple blast resistance check (for now). This keeps the important blocks like bedrock, command block, etc. intact. + -- TODO: Implement the real blast resistance algorithm + if n.name ~= "air" and n.name ~= "ignore" and (def._mcl_blast_resistance == nil or def._mcl_blast_resistance < 1000) then activate_if_tnt(n.name, np, pos, 3) minetest.remove_node(np) core.check_for_falling(np)