MCPcopy Create free account
hub / github.com/Teneted/Tenet / deserialize

Method deserialize

src/main/java/org/bukkit/Location.java:662–673  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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>

Callers

nothing calls this directly

Calls 5

getWorldMethod · 0.95
toDoubleMethod · 0.95
toFloatMethod · 0.95
containsKeyMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected