mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 17:06:16 +00:00
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:
committed by
Dylan K. Taylor
parent
1a6517ea4e
commit
b8a30309bb
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user