diff --git a/src/world/World.php b/src/world/World.php index 934ca83ca..58b2cddb6 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -67,7 +67,6 @@ use pocketmine\world\biome\Biome; use pocketmine\world\format\Chunk; use pocketmine\world\format\io\exception\CorruptedChunkException; use pocketmine\world\format\io\WritableWorldProvider; -use pocketmine\world\generator\Generator; use pocketmine\world\generator\GeneratorManager; use pocketmine\world\generator\GeneratorRegisterTask; use pocketmine\world\generator\GeneratorUnregisterTask; @@ -105,6 +104,7 @@ use function mt_rand; use function spl_object_id; use function strtolower; use function trim; +use function var_dump; use const M_PI; use const PHP_INT_MAX; use const PHP_INT_MIN; @@ -253,7 +253,10 @@ class World implements ChunkManager{ /** @var bool */ private $doingTick = false; - /** @var string|Generator */ + /** + * @var string + * @phpstan-var class-string<\pocketmine\world\generator\Generator> + */ private $generator; /** @var bool */ diff --git a/src/world/format/io/FastChunkSerializer.php b/src/world/format/io/FastChunkSerializer.php index a69ee4cbb..16883a40e 100644 --- a/src/world/format/io/FastChunkSerializer.php +++ b/src/world/format/io/FastChunkSerializer.php @@ -151,6 +151,7 @@ final class FastChunkSerializer{ $chunk->setGenerated($terrainGenerated); $chunk->setPopulated($terrainPopulated); $chunk->setLightPopulated($lightPopulated); + $chunk->clearDirtyFlags(); return $chunk; } diff --git a/src/world/generator/GeneratorRegisterTask.php b/src/world/generator/GeneratorRegisterTask.php index 06060ae0b..831dc7852 100644 --- a/src/world/generator/GeneratorRegisterTask.php +++ b/src/world/generator/GeneratorRegisterTask.php @@ -32,7 +32,10 @@ use function igbinary_unserialize; class GeneratorRegisterTask extends AsyncTask{ - /** @var string */ + /** + * @var string + * @phpstan-var class-string + */ public $generatorClass; /** @var string */ public $settings; @@ -45,6 +48,7 @@ class GeneratorRegisterTask extends AsyncTask{ /** * @param mixed[] $generatorSettings + * @phpstan-param class-string $generatorClass * @phpstan-param array $generatorSettings */ public function __construct(World $world, string $generatorClass, array $generatorSettings = []){ diff --git a/tests/phpstan/configs/l7-baseline.neon b/tests/phpstan/configs/l7-baseline.neon index 1673a1c19..85e86f2f8 100644 --- a/tests/phpstan/configs/l7-baseline.neon +++ b/tests/phpstan/configs/l7-baseline.neon @@ -850,11 +850,6 @@ parameters: count: 1 path: ../../../src/world/Explosion.php - - - message: "#^Parameter \\#2 \\$generatorClass of class pocketmine\\\\world\\\\generator\\\\GeneratorRegisterTask constructor expects string, pocketmine\\\\world\\\\generator\\\\Generator\\|string given\\.$#" - count: 1 - path: ../../../src/world/World.php - - message: "#^Cannot access offset 'priority' on array\\('priority' \\=\\> int, 'data' \\=\\> pocketmine\\\\math\\\\Vector3\\)\\|int\\|pocketmine\\\\math\\\\Vector3\\.$#" count: 1