From 7f30afb2e45ec748193c0b2ff3bdbce8d9fa4ed1 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 3 Aug 2016 12:59:26 +0200 Subject: Better handling of unbreakable nodes --- init.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index f8f8b0c..7237a4b 100644 --- a/init.lua +++ b/init.lua @@ -239,23 +239,22 @@ doc.new_category("nodes", { formstring = formstring .. "This block decreases your breath and causes a drowning damage of "..data.def.drowning.." hit point every 2 seconds.\n" end - if data.def.drops ~= "" then - if data.def.groups.immortal == 1 then - formstring = formstring .. "This block can not be dug by ordinary digging tools.\n" - end + if data.def.drop ~= "" then if data.def.groups.dig_immediate == 2 then - formstring = formstring .. "This block can be dug by any tool in half a second.\n" + formstring = formstring .. "This block can be mined by any mining tool in half a second.\n" elseif data.def.groups.dig_immediate == 3 then - formstring = formstring .. "This block can be dug by any tool immediately.\n" + formstring = formstring .. "This block can be mined by any mining tool immediately.\n" + -- Note: “unbreakable” is an unofficial group for undiggable blocks + elseif data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 or #data.def.groups == 0 then + formstring = formstring .. "This block can not be mined by ordinary mining tools.\n" end else - if data.def.groups.immortal == 1 then - formstring = formstring .. "This block can not be destroyed by ordinary digging tools.\n" - end if data.def.groups.dig_immediate == 2 then - formstring = formstring .. "This block can be destroyed by any tool in half a second.\n" + formstring = formstring .. "This block can be destroyed by any mining tool in half a second.\n" elseif data.def.groups.dig_immediate == 3 then - formstring = formstring .. "This block can be destroyed by any tool immediately.\n" + formstring = formstring .. "This block can be destroyed by any mining tool immediately.\n" + elseif data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 or #data.def.groups == 0 then + formstring = formstring .. "This block can not be destroyed by ordinary mining tools.\n" end end -- cgit v1.2.3