0

Cache rotated chunk data

This results in a small performance gain for rotations, but still
noticeably slower than with no rotation.
This commit is contained in:
Ryan Rector
2011-07-17 08:47:57 -06:00
parent 59594ee442
commit 077552b53b
4 changed files with 52 additions and 41 deletions

5
nbt.py
View File

@@ -210,13 +210,12 @@ class MCRFileReader(object):
self._chunks = None
def get_north_rotations(self):
#Upper-left and lower-right are swapped from chunk.py rots
if self.north_direction == "upper-left":
return 3
return 1
elif self.north_direction == "upper-right":
return 2
elif self.north_direction == "lower-right":
return 1
return 3
elif self.north_direction == "lower-left":
return 0