diff --git a/src/de/craftinc/gates/util/LocationSerializer.java b/src/de/craftinc/gates/util/LocationSerializer.java index cf46581..36ba1a2 100644 --- a/src/de/craftinc/gates/util/LocationSerializer.java +++ b/src/de/craftinc/gates/util/LocationSerializer.java @@ -48,9 +48,30 @@ public class LocationSerializer public static Location deserializeLocation(Map map) throws Exception { World w = getWorld((String)map.get(worldKey)); - double x = (Double) map.get(xKey); - double y = (Double) map.get(yKey); - double z = (Double) map.get(zKey); + + + // verbose loading of coordinates (they might be Double or Integer) + Object objX = map.get(xKey); + Object objY = map.get(yKey); + Object objZ = map.get(zKey); + + double x,y,z; + + if (objX instanceof Integer) + x = (double)(Integer)objX; + else + x = (Double)objX; + + if (objY instanceof Integer) + y = (double)(Integer)objY; + else + y = (Double)objY; + + if (objZ instanceof Integer) + z = (double)(Integer)objZ; + else + z = (Double)objZ; + return new Location(w, x, y, z); }