mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
PHPStan 2.0 fixes
This commit is contained in:
@ -113,6 +113,7 @@ use function array_keys;
|
||||
use function array_map;
|
||||
use function array_merge;
|
||||
use function array_sum;
|
||||
use function array_values;
|
||||
use function assert;
|
||||
use function cos;
|
||||
use function count;
|
||||
@ -678,7 +679,6 @@ class World implements ChunkManager{
|
||||
* Used for broadcasting sounds and particles with specific targets.
|
||||
*
|
||||
* @param Player[] $allowed
|
||||
* @phpstan-param list<Player> $allowed
|
||||
*
|
||||
* @return array<int, Player>
|
||||
*/
|
||||
@ -1089,7 +1089,6 @@ class World implements ChunkManager{
|
||||
|
||||
/**
|
||||
* @param Vector3[] $blocks
|
||||
* @phpstan-param list<Vector3> $blocks
|
||||
*
|
||||
* @return ClientboundPacket[]
|
||||
* @phpstan-return list<ClientboundPacket>
|
||||
@ -1456,8 +1455,8 @@ class World implements ChunkManager{
|
||||
$this->provider->saveChunk($chunkX, $chunkZ, new ChunkData(
|
||||
$chunk->getSubChunks(),
|
||||
$chunk->isPopulated(),
|
||||
array_map(fn(Entity $e) => $e->saveNBT(), array_filter($this->getChunkEntities($chunkX, $chunkZ), fn(Entity $e) => $e->canSaveWithChunk())),
|
||||
array_map(fn(Tile $t) => $t->saveNBT(), $chunk->getTiles()),
|
||||
array_map(fn(Entity $e) => $e->saveNBT(), array_values(array_filter($this->getChunkEntities($chunkX, $chunkZ), fn(Entity $e) => $e->canSaveWithChunk()))),
|
||||
array_map(fn(Tile $t) => $t->saveNBT(), array_values($chunk->getTiles())),
|
||||
), $chunk->getTerrainDirtyFlags());
|
||||
$chunk->clearTerrainDirtyFlags();
|
||||
}
|
||||
@ -3019,8 +3018,8 @@ class World implements ChunkManager{
|
||||
$this->provider->saveChunk($x, $z, new ChunkData(
|
||||
$chunk->getSubChunks(),
|
||||
$chunk->isPopulated(),
|
||||
array_map(fn(Entity $e) => $e->saveNBT(), array_filter($this->getChunkEntities($x, $z), fn(Entity $e) => $e->canSaveWithChunk())),
|
||||
array_map(fn(Tile $t) => $t->saveNBT(), $chunk->getTiles()),
|
||||
array_map(fn(Entity $e) => $e->saveNBT(), array_values(array_filter($this->getChunkEntities($x, $z), fn(Entity $e) => $e->canSaveWithChunk()))),
|
||||
array_map(fn(Tile $t) => $t->saveNBT(), array_values($chunk->getTiles())),
|
||||
), $chunk->getTerrainDirtyFlags());
|
||||
}finally{
|
||||
$this->timings->syncChunkSave->stopTiming();
|
||||
|
Reference in New Issue
Block a user