summaryrefslogtreecommitdiff
path: root/mc-resources.py
diff options
context:
space:
mode:
Diffstat (limited to 'mc-resources.py')
-rw-r--r--mc-resources.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mc-resources.py b/mc-resources.py
index 2614980..cf5dc10 100644
--- a/mc-resources.py
+++ b/mc-resources.py
@@ -98,6 +98,15 @@ def add_recipe(recipe):
else:
recipe_lists[output] = [recipe]
+def recursive_tag_lookup(tag):
+ list = []
+ for id in tag_lists[tag]:
+ if id[0] == '#':
+ list += recursive_tag_lookup(id[1:])
+ else:
+ list.append(id)
+ return list
+
def ilist_product(ilist):
ilist_new = []
for il in ilist:
@@ -106,7 +115,7 @@ def ilist_product(ilist):
il = [il]
for i in il:
if 'tag' in i:
- il_new += tag_lists[i['tag']]
+ il_new += recursive_tag_lookup(i['tag'])
else:
il_new.append(i['item'])
ilist_new.append(il_new)