summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-02 15:55:05 +0200
committerWuzzy <almikes@aol.com>2016-08-02 15:55:05 +0200
commitc1e7ed29841aa55c31727e5d4d1af85b537cffa1 (patch)
treee4227dd67ef4233273ae884c84e15dc115c56e16
parent38aa84bd4fa9c2dddf7e37e7b08ede572f24a23d (diff)
Add group metadata functions
-rw-r--r--init.lua57
1 files changed, 43 insertions, 14 deletions
diff --git a/init.lua b/init.lua
index 22eab5a..acb5d13 100644
--- a/init.lua
+++ b/init.lua
@@ -1,17 +1,8 @@
-local groupdefs = {
-}
-
-local minegroups = {
-}
-
-local damagegroups= {
-}
-
-local forced_nodes = {
-}
-
-local item_name_overrides = {
-}
+local groupdefs = {}
+local minegroups = {}
+local damagegroups= {}
+local forced_nodes = {}
+local item_name_overrides = {}
local groups_to_string = function(grouptable)
local gstring = ""
@@ -518,6 +509,44 @@ function doc.sub.items.add_helptexts(longdesc, usagehelp)
end
end
+-- Register group definition stuff
+-- “Real” group names to replace the rather technical names
+function doc.sub.items.add_real_group_names(groupnames)
+ for internal, real in pairs(groupnames) do
+ groupdefs[internal] = real
+ end
+end
+
+-- List of “real” group names of groups intended for mining
+function doc.sub.items.add_mine_group_names(groupnames)
+ for internal, real in pairs(groupnames) do
+ minegroups[internal] = real
+ end
+end
+
+-- List of “real” group names of groups intended for damage groups
+function doc.sub.items.add_damage_group_names(groupnames)
+ for internal, real in pairs(groupnames) do
+ damagegroups[internal] = real
+ end
+end
+
+-- Add nodes which will be forced to be added to the node list,
+-- even if the node is not in creative inventory
+function doc.sub.items.add_forced_node_entries(itemstrings)
+ for internal, real in pairs(itemstrings) do
+ forced_nodes[internal] = real
+ end
+end
+
+-- Register a list of entry names where the entry name should differ
+-- from the original item description
+function doc.sub.items.add_item_name_overrides(itemstrings)
+ for internal, real in pairs(itemstrings) do
+ item_name_overrides[internal] = real
+ end
+end
+
local function gather_descs()
local help = doc.sub.items.help
doc.new_entry("nodes", "air", {