Fixed: Chunk.bounds now returns a sensible bounding box for its position in the world.

This commit is contained in:
David Vierra 2012-10-28 02:45:08 -10:00
parent 1c6c307585
commit d9d49eb404

View File

@ -767,8 +767,18 @@ class EntityLevel(MCLevel):
class ChunkBase(EntityLevel):
dirty = False
needsLighting = False
chunkPosition = NotImplemented
Blocks = Data = SkyLight = BlockLight = HeightMap = NotImplemented # override these!
Width = Length = 16
@property
def bounds(self):
cx, cz = self.chunkPosition
return BoundingBox((cx << 4, 0, cz << 4), self.size)
def chunkChanged(self, needsLighting=True):
self.dirty = True
self.needsLighting = needsLighting or self.needsLighting