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

Method subtract

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

Subtracts 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

397 * @throws IllegalArgumentException for differing worlds
398 */
399 @NotNull
400 public Location subtract(@NotNull Location vec) {
401 if (vec == null || vec.getWorld() != getWorld()) {
402 throw new IllegalArgumentException("Cannot add Locations of differing worlds");
403 }
404
405 x -= vec.x;
406 y -= vec.y;
407 z -= vec.z;
408 return this;
409 }
410
411 /**
412 * Subtracts the location by a vector.

Callers 1

onInteractEntityAtMethod · 0.45

Calls 5

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

Tested by

no test coverage detected