From 8d6cc52f06af080cc0e874477a29574da1a6a61b Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 19 Sep 2010 15:18:01 -1000 Subject: [PATCH] allow exact matches for block search --- mce.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mce.py b/mce.py index b519255..a9b3a4c 100644 --- a/mce.py +++ b/mce.py @@ -57,17 +57,22 @@ class mce(object): "replace", "export", "import", + "player", "spawn", + "createchunks", "deletechunks", "prune", "relight", + "save", "load", "reload", + "quit", "exit", + "help", "blocks", "debug", @@ -100,6 +105,9 @@ class mce(object): keyword = command.pop(0) def blocksMatching(search): + if search in self.level.materials.names: + #exact match + return [search] return filter(lambda x:search.lower() in x.lower(), self.level.materials.names) matches = blocksMatching(keyword)