summaryrefslogtreecommitdiff
path: root/unified_inventory/group.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-17 14:37:48 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-08-17 14:37:48 -0400
commit2db921cac8002232a3ecd21ad56c262d89e301b4 (patch)
tree6fcd9a5b5a0fb8738413e7ab767928971e4c1caa /unified_inventory/group.lua
parent3f738369862a2f187ea3a53cdd3e8448df19a904 (diff)
downloaddreambuilder_modpack-2db921cac8002232a3ecd21ad56c262d89e301b4.tar
dreambuilder_modpack-2db921cac8002232a3ecd21ad56c262d89e301b4.tar.gz
dreambuilder_modpack-2db921cac8002232a3ecd21ad56c262d89e301b4.tar.bz2
dreambuilder_modpack-2db921cac8002232a3ecd21ad56c262d89e301b4.tar.xz
dreambuilder_modpack-2db921cac8002232a3ecd21ad56c262d89e301b4.zip
updated mesecons and unified inventory
Diffstat (limited to 'unified_inventory/group.lua')
-rw-r--r--unified_inventory/group.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/unified_inventory/group.lua b/unified_inventory/group.lua
index 9bf6895..23e2587 100644
--- a/unified_inventory/group.lua
+++ b/unified_inventory/group.lua
@@ -1,3 +1,5 @@
+local S = unified_inventory.gettext
+
function unified_inventory.canonical_item_spec_matcher(spec)
local specname = ItemStack(spec):get_name()
if specname:sub(1, 6) == "group:" then
@@ -21,9 +23,36 @@ function unified_inventory.item_matches_spec(item, spec)
return unified_inventory.canonical_item_spec_matcher(spec)(itemname)
end
+function unified_inventory.extract_groupnames(groupname)
+ local specname = ItemStack(groupname):get_name()
+ if specname:sub(1, 6) == "group:" then
+ local group_names = specname:sub(7):split(",")
+ if #group_names == 1 then
+ return group_names[1], 1
+ end
+ local s = ""
+ for g=1,#group_names do
+ if g > 1 then
+ -- List connector
+ s = s .. S(" and ")
+ end
+ s = s .. group_names[g]
+ end
+ return s, #group_names
+ else
+ return nil, 0
+ end
+end
+
unified_inventory.registered_group_items = {
mesecon_conductor_craftable = "mesecons:wire_00000000_off",
stone = "default:cobble",
+ wood = "default:wood",
+ book = "default:book",
+ sand = "default:sand",
+ leaves = "default:leaves",
+ tree = "default:tree",
+ vessel = "vessels:glass_bottle",
wool = "wool:white",
}