Required method for deserialization @param args map to deserialize @return deserialized location @throws IllegalArgumentException if the world don't exists @see ConfigurationSerializable
(@NotNull Map<String, Object> args)
| 660 | * @see ConfigurationSerializable |
| 661 | */ |
| 662 | @NotNull |
| 663 | public static Location deserialize(@NotNull Map<String, Object> args) { |
| 664 | World world = null; |
| 665 | if (args.containsKey("world")) { |
| 666 | world = Bukkit.getWorld((String) args.get("world")); |
| 667 | if (world == null) { |
| 668 | throw new IllegalArgumentException("unknown world"); |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | return new Location(world, NumberConversions.toDouble(args.get("x")), NumberConversions.toDouble(args.get("y")), NumberConversions.toDouble(args.get("z")), NumberConversions.toFloat(args.get("yaw")), NumberConversions.toFloat(args.get("pitch"))); |
| 673 | } |
| 674 | |
| 675 | /** |
| 676 | * Normalizes the given yaw angle to a value between <code>+/-180</code> |
nothing calls this directly
no test coverage detected