mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-22 10:56:35 +00:00
World: fixed edge case that could lead to crash during block update sending
This commit is contained in:
parent
a25597ca30
commit
67ad2bad17
@ -1016,8 +1016,12 @@ class World implements ChunkManager{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
World::getXZ($index, $chunkX, $chunkZ);
|
World::getXZ($index, $chunkX, $chunkZ);
|
||||||
|
if(!$this->isChunkLoaded($chunkX, $chunkZ)){
|
||||||
|
//a previous chunk may have caused this one to be unloaded by a ChunkListener
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(count($blocks) > 512){
|
if(count($blocks) > 512){
|
||||||
$chunk = $this->getChunk($chunkX, $chunkZ);
|
$chunk = $this->getChunk($chunkX, $chunkZ) ?? throw new AssumptionFailedError("We already checked that the chunk is loaded");
|
||||||
foreach($this->getChunkPlayers($chunkX, $chunkZ) as $p){
|
foreach($this->getChunkPlayers($chunkX, $chunkZ) as $p){
|
||||||
$p->onChunkChanged($chunkX, $chunkZ, $chunk);
|
$p->onChunkChanged($chunkX, $chunkZ, $chunk);
|
||||||
}
|
}
|
||||||
|
@ -960,11 +960,6 @@ parameters:
|
|||||||
count: 2
|
count: 2
|
||||||
path: ../../../src/world/World.php
|
path: ../../../src/world/World.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Parameter \\#3 \\$chunk of method pocketmine\\\\player\\\\Player\\:\\:onChunkChanged\\(\\) expects pocketmine\\\\world\\\\format\\\\Chunk, pocketmine\\\\world\\\\format\\\\Chunk\\|null given\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: ../../../src/world/World.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#3 \\$y of method pocketmine\\\\block\\\\Block\\:\\:position\\(\\) expects int, float\\|int given\\.$#"
|
message: "#^Parameter \\#3 \\$y of method pocketmine\\\\block\\\\Block\\:\\:position\\(\\) expects int, float\\|int given\\.$#"
|
||||||
count: 2
|
count: 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user