summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-03 12:59:26 +0200
committerWuzzy <almikes@aol.com>2016-08-03 12:59:26 +0200
commit7f30afb2e45ec748193c0b2ff3bdbce8d9fa4ed1 (patch)
treed4deffe66aa03473bf834fd7f88e55fe50b96b80
parentedf74a5af8c9644371d5f58724a26b4a6c193dec (diff)
Better handling of unbreakable nodes
-rw-r--r--init.lua21
1 files changed, 10 insertions, 11 deletions
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