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

Method add

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

Adds the location by another. @see Vector @param vec The other location @return the same location @throws IllegalArgumentException for differing worlds

(@NotNull Location vec)

Source from the content-addressed store, hash-verified

345 * @throws IllegalArgumentException for differing worlds
346 */
347 @NotNull
348 public Location add(@NotNull Location vec) {
349 if (vec == null || vec.getWorld() != getWorld()) {
350 throw new IllegalArgumentException("Cannot add Locations of differing worlds");
351 }
352
353 x += vec.x;
354 y += vec.y;
355 z += vec.z;
356 return this;
357 }
358
359 /**
360 * Adds the location by a vector.

Callers

nothing calls this directly

Calls 5

getWorldMethod · 0.95
getWorldMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getZMethod · 0.65

Tested by

no test coverage detected