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

Method equals

src/main/java/org/bukkit/util/Vector.java:725–734  ·  view source on GitHub ↗

Checks to see if two objects are equal. Only two Vectors can ever return true. This method uses a fuzzy match to account for floating point errors. The epsilon can be retrieved with epsilon.

(Object obj)

Source from the content-addressed store, hash-verified

723 * with epsilon.
724 */
725 @Override
726 public boolean equals(Object obj) {
727 if (!(obj instanceof Vector)) {
728 return false;
729 }
730
731 Vector other = (Vector) obj;
732
733 return Math.abs(x - other.x) < epsilon && Math.abs(y - other.y) < epsilon && Math.abs(z - other.z) < epsilon && (this.getClass().equals(obj.getClass()));
734 }
735
736 /**
737 * Returns a hash code for this vector

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.65

Tested by

no test coverage detected