Cleaned up mcitems a bit

This commit is contained in:
Luke Rogers 2012-05-17 07:47:49 +12:00
parent ace1743891
commit 1078f12770

View file

@ -67,9 +67,8 @@ def mcitem(input, reply=None):
elif input in name.lower():
results.append("\x02[%s]\x02 %s" % (id, name))
if not len(results):
reply("No matches found.")
return
if not results:
return "No matches found."
if len(results) > 12:
reply("There are too many options, please narrow your search. " \
@ -87,15 +86,11 @@ def mcrecipe(input, reply=None):
"mcrecipe <item> -- gets the crafting recipe for an item"
input = input.lower().strip()
results = []
results = [recipe.line for recipe in recipelist
if input in recipe.output]
for recipe in recipelist:
if input in recipe.output:
results.append(recipe.line)
if not len(results):
reply("No matches found.")
return
if not results:
return "No matches found."
if len(results) > 3:
reply("There are too many options, please narrow your search. " \