From 6085feb50caaab2630c0fb43a46db38c3385171a Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 31 Oct 2010 13:06:09 -1000 Subject: [PATCH] check for float NaN and use 0 instead --- mclevel.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mclevel.py b/mclevel.py index 5e74825..0360165 100644 --- a/mclevel.py +++ b/mclevel.py @@ -803,7 +803,9 @@ class MCLevel(object): copyOffset = map(lambda x,y:x-y, destinationPoint, sourceBox.origin) for entity in chunk.Entities: - x,y,z = map(lambda x:int(x.value), entity[Pos]) + pos = map(lambda x:x.value, entity[Pos]) + x,y,z = [0 if isnan(p) else int(floor(p)) for p in pos]; + if x-wx=slices[0].stop: continue if y=slices[2].stop: continue if z-wz=slices[1].stop: continue