Do not cast to Double. Rather use Number.

This commit is contained in:
Tobias Ottenweller 2013-06-23 17:14:51 +02:00
parent b50a2b27d3
commit d4f33a1885

View File

@ -274,13 +274,13 @@ public class Gate implements ConfigurationSerializable
exit = LocationUtil.deserializeLocation((Map<String, Object>) map.get(exitKey)); exit = LocationUtil.deserializeLocation((Map<String, Object>) map.get(exitKey));
if (map.containsKey(exitPitchKey)) { if (map.containsKey(exitPitchKey)) {
exit.setPitch(((Double)map.get(exitPitchKey)).floatValue()); exit.setPitch(((Number)map.get(exitPitchKey)).floatValue());
exit.setYaw(((Double)map.get(exitYawKey)).floatValue()); exit.setYaw(((Number)map.get(exitYawKey)).floatValue());
} }
if (map.containsKey(locationPitchKey)) { if (map.containsKey(locationPitchKey)) {
location.setPitch(((Double)map.get(locationPitchKey)).floatValue()); location.setPitch(((Number)map.get(locationPitchKey)).floatValue());
location.setYaw(((Double)map.get(locationYawKey)).floatValue()); location.setYaw(((Number)map.get(locationYawKey)).floatValue());
} }
gateBlockLocations = new HashSet<Location>(); gateBlockLocations = new HashSet<Location>();