MCPcopy Index your code
hub / github.com/PaperMC/Paper / add

Method add

paper-api/src/main/java/org/bukkit/Location.java:355–365  ·  view source on GitHub ↗

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

(@NotNull Location vec)

Source from the content-addressed store, hash-verified

353 * @see Vector
354 */
355 @NotNull
356 public Location add(@NotNull Location vec) {
357 if (vec == null || vec.getWorld() != getWorld()) {
358 throw new IllegalArgumentException("Cannot add Locations of differing worlds");
359 }
360
361 x += vec.x;
362 y += vec.y;
363 z += vec.z;
364 return this;
365 }
366
367 /**
368 * Adds the location by a vector.

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected