don't recompute the directory name table every time
This commit is contained in:
parent
61ec62f9d2
commit
efe5fbabf8
@ -1842,9 +1842,6 @@ class MCInfdevOldLevel(MCLevel):
|
||||
info( "level.dat restored from backup." )
|
||||
self.saveInPlace();
|
||||
|
||||
self.dirhashes = [self.dirhash(n) for n in range(64)];
|
||||
self.dirhash=self.dirhashlookup;
|
||||
|
||||
playerFilePath = os.path.join(self.worldDir, "players")
|
||||
if os.path.isdir(playerFilePath):
|
||||
self.players = [x[:-4] for x in os.listdir(playerFilePath) if x.endswith(".dat")]
|
||||
@ -1949,10 +1946,10 @@ class MCInfdevOldLevel(MCLevel):
|
||||
|
||||
return neg + ''.join(reversed(work))
|
||||
|
||||
def dirhashlookup(self, n):
|
||||
def dirhash(self, n):
|
||||
return self.dirhashes[n%64];
|
||||
|
||||
def dirhash(self, n):
|
||||
def _dirhash(n):
|
||||
n=n%64;
|
||||
s=u"";
|
||||
if(n>=36):
|
||||
@ -1962,6 +1959,8 @@ class MCInfdevOldLevel(MCLevel):
|
||||
|
||||
return s;
|
||||
|
||||
dirhashes = [_dirhash(n) for n in range(64)];
|
||||
|
||||
|
||||
def chunkFilename(self, x, z):
|
||||
s= os.path.join(self.worldDir, self.dirhash(x), self.dirhash(z),
|
||||
|
Reference in New Issue
Block a user