From 55e83e50da5b4ec1477d32093de503045027cf42 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 1 Jan 2012 22:31:10 -0500 Subject: [PATCH] chunks are now loaded properly from the regionset --- overviewer_core/world.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index cc5ad6d..ffa6878 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -222,16 +222,20 @@ but may be several per invocation of the Overviewer in the case of multi-world. regionfile = self.regionfiles.get((chunkX//32, chunkY//32),None) return regionfile - def get_chunk(self,x, y): + def get_chunk(self,x, z): """Returns a dictionary representing the top-level NBT Compound for a chunk given its x, z coordinates. The coordinates are chunk coordinates. """ - regionfile = self.get_region_path(x,y) + regionfile = self.get_region_path(x, z) if regionfile is None: return None - data = nbt.load_region(regionfile) + region = nbt.load_region(regionfile) + data = region.load_chunk(x, z) + region.close() + if data is None: + return None level = data[1]['Level'] chunk_data = level