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

Method subtract

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

Subtracts 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

445 * @see Vector
446 */
447 @NotNull
448 public Location subtract(@NotNull Location vec) {
449 if (vec == null || vec.getWorld() != getWorld()) {
450 throw new IllegalArgumentException("Cannot add Locations of differing worlds");
451 }
452
453 x -= vec.x;
454 y -= vec.y;
455 z -= vec.z;
456 return this;
457 }
458
459 /**
460 * Subtracts 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