make MCMaterials an iterable over its own blocks
This commit is contained in:
parent
b82b617f8b
commit
731390e40a
@ -105,7 +105,13 @@ class MCMaterials(object):
|
||||
return self[key]
|
||||
except KeyError:
|
||||
return default
|
||||
|
||||
|
||||
def __len__(self):
|
||||
return len(self.allBlocks)
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.allBlocks)
|
||||
|
||||
def __getitem__(self, key):
|
||||
""" Let's be magic. If we get a string, return the first block whose
|
||||
name matches exactly. If we get a (id, data) pair or an id, return
|
||||
|
Reference in New Issue
Block a user