From bf1f2bcff221b382a534ec9fae5b730204ef4826 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 10 Feb 2013 15:40:18 +0100 Subject: [PATCH] Fixed loading of gates created by version 2.0.0 --- src/de/craftinc/gates/Gate.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de/craftinc/gates/Gate.java b/src/de/craftinc/gates/Gate.java index de99344..5602517 100644 --- a/src/de/craftinc/gates/Gate.java +++ b/src/de/craftinc/gates/Gate.java @@ -84,13 +84,15 @@ public class Gate extends BaseGate implements ConfigurationSerializable location = LocationSerializer.deserializeLocation((Map) map.get(locationKey)); exit = LocationSerializer.deserializeLocation((Map) map.get(exitKey)); - if (exit != null) { + if (map.containsKey(exitPitchKey)) { exit.setPitch(((Double)map.get(exitPitchKey)).floatValue()); exit.setYaw(((Double)map.get(exitYawKey)).floatValue()); } - location.setPitch(((Double)map.get(locationPitchKey)).floatValue()); - location.setYaw(((Double)map.get(locationYawKey)).floatValue()); + if (map.containsKey(locationPitchKey)) { + location.setPitch(((Double)map.get(locationPitchKey)).floatValue()); + location.setYaw(((Double)map.get(locationYawKey)).floatValue()); + } gateBlockLocations = new HashSet(); List> serializedGateBlocks = (List>)map.get(gateBlocksKey);