Added isChunkAligned to BoundingBox
This commit is contained in:
parent
0d2e715fb3
commit
c962a32585
4
box.py
4
box.py
@ -100,7 +100,9 @@ class BoundingBox (object):
|
|||||||
return itertools.product(xrange(self.mincx,self.maxcx), xrange(self.mincz, self.maxcz));
|
return itertools.product(xrange(self.mincx,self.maxcx), xrange(self.mincz, self.maxcz));
|
||||||
|
|
||||||
|
|
||||||
|
@property
|
||||||
|
def isChunkAligned(self):
|
||||||
|
return (self.origin[0] & 0xf == 0) and (self.origin[2] & 0xf == 0)
|
||||||
|
|
||||||
def __contains__(self, pos):
|
def __contains__(self, pos):
|
||||||
x,y,z = pos;
|
x,y,z = pos;
|
||||||
|
@ -1024,8 +1024,7 @@ class MCLevel(object):
|
|||||||
|
|
||||||
destBox = BoundingBox(destPoint, sourceBox.size);
|
destBox = BoundingBox(destPoint, sourceBox.size);
|
||||||
|
|
||||||
if ((sourceBox.origin[0] & 0xf == 0) and
|
if (sourceBox.isChunkAligned):
|
||||||
(sourceBox.origin[2] & 0xf == 0)):
|
|
||||||
#create chunks in the destination area corresponding only to chunks
|
#create chunks in the destination area corresponding only to chunks
|
||||||
#present in the source
|
#present in the source
|
||||||
chunks = sourceBox.chunkPositions
|
chunks = sourceBox.chunkPositions
|
||||||
|
Reference in New Issue
Block a user