mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
Player: fixed logic of move-into-bad-chunk checks
particularly the hack with chunk switching was causing unexpected behaviour wrt. invisible players.
This commit is contained in:
parent
c19cf22ac5
commit
a185b78486
@ -1541,17 +1541,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
$this->server->getLogger()->debug("Old position: " . $this->asVector3() . ", new position: " . $this->newPosition);
|
$this->server->getLogger()->debug("Old position: " . $this->asVector3() . ", new position: " . $this->newPosition);
|
||||||
$revert = true;
|
$revert = true;
|
||||||
}else{
|
}else{
|
||||||
if($this->chunk === null or !$this->chunk->isGenerated()){
|
$chunkX = $newPos->getFloorX() >> 4;
|
||||||
$chunk = $this->level->getChunk($newPos->getFloorX() >> 4, $newPos->getFloorZ() >> 4, false);
|
$chunkZ = $newPos->getFloorZ() >> 4;
|
||||||
if($chunk === null or !$chunk->isGenerated()){
|
|
||||||
|
if(!$this->level->isChunkLoaded($chunkX, $chunkZ) or !$this->level->isChunkGenerated($chunkX, $chunkZ)){
|
||||||
$revert = true;
|
$revert = true;
|
||||||
$this->nextChunkOrderRun = 0;
|
$this->nextChunkOrderRun = 0;
|
||||||
}else{
|
|
||||||
if($this->chunk !== null){
|
|
||||||
$this->chunk->removeEntity($this);
|
|
||||||
}
|
|
||||||
$this->chunk = $chunk;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user