summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-05 00:33:08 +0200
committerWuzzy <almikes@aol.com>2016-08-05 00:33:08 +0200
commit42788d5a0c81397449ec3f53b62eeb35d9a15258 (patch)
tree923d9e9ae3652e98ea03c72a5ee6709a8d9078a7
parent6d4fc4531d3a63ae4a3e6c258849912fe6c75c5e (diff)
Move some factoids around
-rw-r--r--init.lua87
1 files changed, 45 insertions, 42 deletions
diff --git a/init.lua b/init.lua
index 3892a65..a93d0c2 100644
--- a/init.lua
+++ b/init.lua
@@ -278,33 +278,6 @@ 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
- --[[ Check if there are no groups at all, helps for finding undiggable nodes,
- -- but this approach might miss some of these; still better than nothing. ]]
- local nogroups = true
- for k,v in pairs(data.def.groups) do
- -- If this is reached once, we know the groups table is not empty
- nogroups = false
- break
- end
- if data.def.drop ~= "" then
- if data.def.groups.dig_immediate == 2 then
- 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 mined by any mining tool immediately.\n"
- -- Note: “unbreakable” is an unofficial group for undiggable blocks
- elseif nogroups or data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 then
- formstring = formstring .. "This block can not be mined by ordinary mining tools.\n"
- end
- else
- if data.def.groups.dig_immediate == 2 then
- 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 mining tool immediately.\n"
- elseif nogroups or data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 then
- formstring = formstring .. "This block can not be destroyed by ordinary mining tools.\n"
- end
- end
-
if data.def.groups.falling_node == 1 then
formstring = formstring .. "This block is affected by gravity and can fall.\n"
end
@@ -337,25 +310,55 @@ doc.new_category("nodes", {
formstring = formstring .. "\n"
- -- Expose mining groups (crumbly, cracky, etc.) and level group
- local mstring = "This block can be mined by mining tools which match any of the following mining ratings and its mining level.\n"
- mstring = mstring .. "Mining ratings:\n"
- local minegroupcount = 0
- for group,_ in pairs(mininggroups) do
- local rating = data.def.groups[group]
- if rating ~= nil then
- mstring = mstring .. "- "..groupdefs[group]..": "..rating.."\n"
- minegroupcount = minegroupcount + 1
- end
+ --[[ Check if there are no groups at all, helps for finding undiggable nodes,
+ -- but this approach might miss some of these; still better than nothing. ]]
+ local nogroups = true
+ for k,v in pairs(data.def.groups) do
+ -- If this is reached once, we know the groups table is not empty
+ nogroups = false
+ break
end
- if data.def.groups.level ~= nil then
- mstring = mstring .. "Mining level: "..data.def.groups.level.."\n"
+ -- dig_immediate
+ if data.def.drop ~= "" then
+ if data.def.groups.dig_immediate == 2 then
+ 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 mined by any mining tool immediately.\n"
+ -- Note: “unbreakable” is an unofficial group for undiggable blocks
+ elseif nogroups or data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 then
+ formstring = formstring .. "This block can not be mined by ordinary mining tools.\n"
+ end
else
- mstring = mstring .. "Mining level: 0\n"
+ if data.def.groups.dig_immediate == 2 then
+ 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 mining tool immediately.\n"
+ elseif nogroups or data.def.groups.immortal == 1 or data.def.groups.unbreakable == 1 then
+ formstring = formstring .. "This block can not be destroyed by ordinary mining tools.\n"
+ end
end
+ -- Expose “ordinary” mining groups (crumbly, cracky, etc.) and level group
+ -- Skip this for immediate digging to avoid redundancy
+ if data.def.groups.dig_immediate ~= 3 then
+ local mstring = "This block can be mined by mining tools which match any of the following mining ratings and its mining level.\n"
+ mstring = mstring .. "Mining ratings:\n"
+ local minegroupcount = 0
+ for group,_ in pairs(mininggroups) do
+ local rating = data.def.groups[group]
+ if rating ~= nil then
+ mstring = mstring .. "- "..groupdefs[group]..": "..rating.."\n"
+ minegroupcount = minegroupcount + 1
+ end
+ end
+ if data.def.groups.level ~= nil then
+ mstring = mstring .. "Mining level: "..data.def.groups.level.."\n"
+ else
+ mstring = mstring .. "Mining level: 0\n"
+ end
- if minegroupcount > 0 then
- formstring = formstring .. mstring
+ if minegroupcount > 0 then
+ formstring = formstring .. mstring
+ end
end
formstring = formstring .. "\n"