mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-25 12:54:03 +00:00
World: remove useless internal function
this just complicates the logic for no reason. It had a purpose once, but no longer.
This commit is contained in:
parent
c1a483a36d
commit
51548d1a27
@ -2416,16 +2416,6 @@ class World implements ChunkManager, Metadatable{
|
|||||||
$this->chunkSendQueue[$index][spl_object_id($player)] = $player;
|
$this->chunkSendQueue[$index][spl_object_id($player)] = $player;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onChunkReady(int $x, int $z){
|
|
||||||
if(isset($this->chunkSendQueue[$index = World::chunkHash($x, $z)])){
|
|
||||||
foreach($this->chunkSendQueue[$index] as $player){
|
|
||||||
/** @var Player $player */
|
|
||||||
$player->onChunkReady($x, $z);
|
|
||||||
}
|
|
||||||
unset($this->chunkSendQueue[$index]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function processChunkRequests(){
|
private function processChunkRequests(){
|
||||||
if(count($this->chunkSendQueue) > 0){
|
if(count($this->chunkSendQueue) > 0){
|
||||||
$this->timings->syncChunkSendTimer->startTiming();
|
$this->timings->syncChunkSendTimer->startTiming();
|
||||||
@ -2439,10 +2429,16 @@ class World implements ChunkManager, Metadatable{
|
|||||||
if($chunk === null or !$chunk->isGenerated() or !$chunk->isPopulated()){
|
if($chunk === null or !$chunk->isGenerated() or !$chunk->isPopulated()){
|
||||||
throw new ChunkException("Invalid Chunk sent");
|
throw new ChunkException("Invalid Chunk sent");
|
||||||
}
|
}
|
||||||
$this->onChunkReady($x, $z);
|
|
||||||
|
foreach($players as $player){
|
||||||
|
$player->onChunkReady($x, $z);
|
||||||
|
}
|
||||||
|
|
||||||
$this->timings->syncChunkSendPrepareTimer->stopTiming();
|
$this->timings->syncChunkSendPrepareTimer->stopTiming();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->chunkSendQueue = [];
|
||||||
|
|
||||||
$this->timings->syncChunkSendTimer->stopTiming();
|
$this->timings->syncChunkSendTimer->stopTiming();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user