From d9d49eb404a2adc40f97bc0710aef189c89d4b14 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 28 Oct 2012 02:45:08 -1000 Subject: [PATCH] Fixed: Chunk.bounds now returns a sensible bounding box for its position in the world. --- level.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/level.py b/level.py index cecda1e..61a79e2 100644 --- a/level.py +++ b/level.py @@ -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