diff --git a/src/player/Player.php b/src/player/Player.php index d489d81a9..8ae7ac732 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -2365,7 +2365,8 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ } public function onChunkChanged(Chunk $chunk) : void{ - if(isset($this->usedChunks[$hash = World::chunkHash($chunk->getX(), $chunk->getZ())])){ + $status = $this->usedChunks[$hash = World::chunkHash($chunk->getX(), $chunk->getZ())] ?? null; + if($status !== null && !$status->equals(UsedChunkStatus::NEEDED())){ $this->usedChunks[$hash] = UsedChunkStatus::NEEDED(); $this->nextChunkOrderRun = 0; } diff --git a/tests/phpstan/configs/runtime-type-checks.neon b/tests/phpstan/configs/runtime-type-checks.neon index 023d06b89..d32f9538f 100644 --- a/tests/phpstan/configs/runtime-type-checks.neon +++ b/tests/phpstan/configs/runtime-type-checks.neon @@ -5,11 +5,6 @@ parameters: count: 1 path: ../../../src/block/BaseBanner.php - - - message: "#^Call to function assert\\(\\) with bool will always evaluate to true\\.$#" - count: 1 - path: ../../../src/block/tile/TileFactory.php - - message: "#^Instanceof between pocketmine\\\\event\\\\RegisteredListener and pocketmine\\\\event\\\\RegisteredListener will always evaluate to true\\.$#" count: 1 @@ -65,8 +60,3 @@ parameters: count: 1 path: ../../../src/world/World.php - - - message: "#^Call to function assert\\(\\) with bool will always evaluate to true\\.$#" - count: 1 - path: ../../../src/world/World.php -