From c932ec015ce883709b17eef3b3af2669f32df5fd Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sat, 18 Sep 2010 01:55:48 -1000 Subject: [PATCH] adjust bounds for schematic extraction, at least vertically xxx --- mclevel.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mclevel.py b/mclevel.py index 4f6bf84..46544d8 100644 --- a/mclevel.py +++ b/mclevel.py @@ -819,6 +819,19 @@ class MCLevel: blocks[:] = sourceBlocks[:] def extractSchematic(self, box): + x,y,z = box.origin + w,h,l = box.size + if y<0: + h += y + y = 0; + if y+h>self.Height: + h -=y+h-self.Height + y=self.Height-h + + box.origin = x,y,z + box.size = w,h,l + + tempSchematic = MCSchematic(shape=box.size) tempSchematic.materials = self.materials tempSchematic.copyBlocksFrom(self, box, (0,0,0))