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

Method equals

src/main/java/org/bukkit/Location.java:536–567  ·  view source on GitHub ↗
(Object obj)

Source from the content-addressed store, hash-verified

534 }
535
536 @Override
537 public boolean equals(Object obj) {
538 if (obj == null) {
539 return false;
540 }
541 if (getClass() != obj.getClass()) {
542 return false;
543 }
544 final Location other = (Location) obj;
545
546 World world = (this.world == null) ? null : this.world.get();
547 World otherWorld = (other.world == null) ? null : other.world.get();
548 if (world != otherWorld && (world == null || !world.equals(otherWorld))) {
549 return false;
550 }
551 if (Double.doubleToLongBits(this.x) != Double.doubleToLongBits(other.x)) {
552 return false;
553 }
554 if (Double.doubleToLongBits(this.y) != Double.doubleToLongBits(other.y)) {
555 return false;
556 }
557 if (Double.doubleToLongBits(this.z) != Double.doubleToLongBits(other.z)) {
558 return false;
559 }
560 if (Float.floatToIntBits(this.pitch) != Float.floatToIntBits(other.pitch)) {
561 return false;
562 }
563 if (Float.floatToIntBits(this.yaw) != Float.floatToIntBits(other.yaw)) {
564 return false;
565 }
566 return true;
567 }
568
569 @Override
570 public int hashCode() {

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected