From aeac1b1883d24e7a33f996894f232b3beb30a212 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 11 Jan 2015 13:28:34 -1000 Subject: [PATCH] Camera view skips chunks outside the view distance (chunks that would be offered because the minimap loaded them) --- src/mcedit2/worldview/camera.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mcedit2/worldview/camera.py b/src/mcedit2/worldview/camera.py index dad0b9e..67c0fda 100644 --- a/src/mcedit2/worldview/camera.py +++ b/src/mcedit2/worldview/camera.py @@ -188,6 +188,15 @@ class CameraWorldView(WorldView): log.debug("Discarding %d chunks...", len(chunks)) worldScene.discardChunks(chunks) + def recieveChunk(self, chunk): + cx, cz = chunk.chunkPosition + x, y, z = self.viewCenter().chunkPos() + dx = abs(cx - x) + dz = abs(cz - z) + if dx > self.viewDistance or dz > self.viewDistance: + return iter([]) + return super(CameraWorldView, self).recieveChunk(chunk) + class CameraElevateMouseAction(ViewMouseAction): labelText = "Wheel Controls Camera Elevation"