Fixed: Chunk.bounds now returns a sensible bounding box for its position in the world.
This commit is contained in:
parent
1c6c307585
commit
d9d49eb404
10
level.py
10
level.py
@ -767,8 +767,18 @@ class EntityLevel(MCLevel):
|
|||||||
class ChunkBase(EntityLevel):
|
class ChunkBase(EntityLevel):
|
||||||
dirty = False
|
dirty = False
|
||||||
needsLighting = False
|
needsLighting = False
|
||||||
|
|
||||||
|
chunkPosition = NotImplemented
|
||||||
Blocks = Data = SkyLight = BlockLight = HeightMap = NotImplemented # override these!
|
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):
|
def chunkChanged(self, needsLighting=True):
|
||||||
self.dirty = True
|
self.dirty = True
|
||||||
self.needsLighting = needsLighting or self.needsLighting
|
self.needsLighting = needsLighting or self.needsLighting
|
||||||
|
Reference in New Issue
Block a user