mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 20:35:15 +00:00
Fixed E_NOTICE error on player movement
This commit is contained in:
parent
82d903733d
commit
b231eba803
@ -1108,7 +1108,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$revert = true;
|
$revert = true;
|
||||||
}else{
|
}else{
|
||||||
if($this->chunk === null or !$this->chunk->isGenerated()){
|
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()){
|
if(!($chunk instanceof FullChunk) or !$chunk->isGenerated()){
|
||||||
$revert = true;
|
$revert = true;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,9 @@ class Vector3{
|
|||||||
return $this->x * $this->x + $this->y * $this->y + $this->z * $this->z;
|
return $this->x * $this->x + $this->y * $this->y + $this->z * $this->z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Vector3
|
||||||
|
*/
|
||||||
public function normalize(){
|
public function normalize(){
|
||||||
$len = $this->length();
|
$len = $this->length();
|
||||||
if($len != 0){
|
if($len != 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user