From 0f70421fde455c1432f2fadef76a44009809ea5b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Sep 2010 15:35:54 -1000 Subject: [PATCH] compute a fake whiteLight array depending on the level's size --- mclevel.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mclevel.py b/mclevel.py index 844d75c..05118e8 100644 --- a/mclevel.py +++ b/mclevel.py @@ -366,17 +366,21 @@ class MCLevel: presentChunks = property(getPresentChunks) def getChunk(self, cx, cz): - if not hasattr(self, 'whiteLight'): - self.whiteLight = array([[[15] * self.Height] * 16] * 16, uint8); + #if not hasattr(self, 'whiteLight'): + #self.whiteLight = array([[[15] * self.Height] * 16] * 16, uint8); class FakeChunk: def load(self):pass def compress(self):pass - + f = FakeChunk() f.Blocks = self.blocksForChunk(cx, cz) - f.BlockLight = self.whiteLight - f.SkyLight = self.whiteLight + + whiteLight = zeros_like(f.Blocks); + whiteLight[:] = 15; + + f.BlockLight = whiteLight + f.SkyLight = whiteLight f.root_tag = TAG_Compound(); return f