Exemplo n.º 1
0
Arquivo: mce.py Projeto: JYF/pymclevel
 def loadWorld(self, world):
     try:
         worldNum = int(world)
         if str(worldNum) == world:
             self.level = mclevel.loadWorldNumber(worldNum)
             
     except ValueError:
         self.level = mclevel.fromFile(world)
Exemplo n.º 2
0
 def loadWorld(self, world):
     try:
         worldNum = int(world)
     except ValueError:
         self.level = mclevel.fromFile(world)
         
         self.filename = self.level.filename
         
         
         
     else:
         if str(worldNum) == world:
             if worldNum > 0 and worldNum <= 5:
                 self.level = mclevel.loadWorldNumber(worldNum)
                 self.filename = self.level.filename
Exemplo n.º 3
0
 def loadWorld(self, world):
     try:
         worldNum = int(world)
     except ValueError:
         self.level = mclevel.fromFile(world)
         
         self.filename = self.level.filename
         
         self.shortWorld = os.path.split(self.level.filename)[1];
         if self.shortWorld == "level.dat":
             self.shortWorld = os.path.split(os.path.split(self.level.filename)[0])[1];
     
     else:
         if str(worldNum) == world:
             if worldNum > 0 and worldNum <= 5:
                 self.level = mclevel.loadWorldNumber(worldNum)
                 self.filename = self.level.filename
                 
                 self.shortWorld = "World{0}".format(worldNum)