From 1c366dcba88743828f4ce5cfb342031e849fff54 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Tue, 10 Apr 2012 01:58:00 -0400 Subject: [PATCH] fix newly created region files getting the wrong extension --- infiniteworld.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/infiniteworld.py b/infiniteworld.py index 4653c2f..234da0c 100644 --- a/infiniteworld.py +++ b/infiniteworld.py @@ -2761,9 +2761,12 @@ class MCInfdevOldLevel(ChunkedLevelMixin, EntityLevel): dirhashes = [_dirhash(n) for n in range(64)] def regionFilename(self, rx, rz): - s = os.path.join(self.regionDir, - "r.%s.%s.mcr" % (rx, rz)) - return s + if self.version == self.VERSION_MCR: + EXTENSION = "mcr" + elif self.version == self.VERSION_ANVIL: + EXTENSION = "mca" + + return os.path.join(self.regionDir, "r.%s.%s.%s" % (rx, rz, EXTENSION)) def chunkFilename(self, cx, cz): s = os.path.join(self.worldDir, self.dirhash(cx), self.dirhash(cz),