added displayName property
This commit is contained in:
parent
2b1ac7cb12
commit
1243d1a7a6
12
mclevel.py
12
mclevel.py
@ -350,6 +350,10 @@ class MCLevel(object):
|
|||||||
def getWorldBounds(self):
|
def getWorldBounds(self):
|
||||||
return BoundingBox( (0,0,0), self.size )
|
return BoundingBox( (0,0,0), self.size )
|
||||||
|
|
||||||
|
@property
|
||||||
|
def displayName(self):
|
||||||
|
return os.path.basename(self.filename)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
"Returns the level's dimensions as a tuple (X,Y,Z)"
|
"Returns the level's dimensions as a tuple (X,Y,Z)"
|
||||||
@ -1652,6 +1656,14 @@ class MCInfdevOldLevel(MCLevel):
|
|||||||
materials = materials;
|
materials = materials;
|
||||||
hasEntities = True;
|
hasEntities = True;
|
||||||
|
|
||||||
|
@property
|
||||||
|
def displayName(self):
|
||||||
|
#shortname = os.path.basename(self.filename);
|
||||||
|
#if shortname == "level.dat":
|
||||||
|
shortname = os.path.basename(os.path.dirname(self.filename))
|
||||||
|
|
||||||
|
return shortname
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _isLevel(cls, filename):
|
def _isLevel(cls, filename):
|
||||||
if os.path.isdir(filename):
|
if os.path.isdir(filename):
|
||||||
|
Reference in New Issue
Block a user