Fixed E_NOTICE error on player movement

This commit is contained in:
Shoghi Cervantes 2014-09-26 13:23:47 +02:00
parent 82d903733d
commit b231eba803
2 changed files with 4 additions and 1 deletions

View File

@ -1108,7 +1108,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$revert = true;
}else{
if($this->chunk === null or !$this->chunk->isGenerated()){
$chunk = $this->getLevel()->getChunk($newPos->x >> 4, $newPos->z >> 4);
$chunk = $this->getLevel()->getChunk($this->newPosition->x >> 4, $this->newPosition->z >> 4);
if(!($chunk instanceof FullChunk) or !$chunk->isGenerated()){
$revert = true;
}

View File

@ -179,6 +179,9 @@ class Vector3{
return $this->x * $this->x + $this->y * $this->y + $this->z * $this->z;
}
/**
* @return Vector3
*/
public function normalize(){
$len = $this->length();
if($len != 0){