Improve checks for Position::equals() and Location::equals() (#929)

* Add files via upload

* Position::$level can be null.

* Use getLevel() in place of $level

because of WeakPosition.
This commit is contained in:
Muqsit Rayyan
2017-07-04 22:25:25 +03:00
committed by Dylan K. Taylor
parent 1a6517ea4e
commit b8a30309bb
2 changed files with 13 additions and 0 deletions

View File

@ -133,4 +133,10 @@ class Position extends Vector3{
return $this;
}
public function equals(Vector3 $v){
if($v instanceof Position){
return parent::equals($v) and $v->getLevel() === $this->getLevel();
}
return parent::equals($v);
}
}