mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
remove a couple more Position->getWorld() usages
This commit is contained in:
@@ -805,8 +805,7 @@ class NetworkSession{
|
||||
public function startUsingChunk(int $chunkX, int $chunkZ, \Closure $onCompletion) : void{
|
||||
Utils::validateCallableSignature(function(int $chunkX, int $chunkZ) : void{}, $onCompletion);
|
||||
|
||||
$world = $this->player->getLocation()->getWorld();
|
||||
assert($world !== null);
|
||||
$world = $this->player->getLocation()->getWorldNonNull();
|
||||
ChunkCache::getInstance($world, $this->compressor)->request($chunkX, $chunkZ)->onResolve(
|
||||
|
||||
//this callback may be called synchronously or asynchronously, depending on whether the promise is resolved yet
|
||||
@@ -814,7 +813,7 @@ class NetworkSession{
|
||||
if(!$this->isConnected()){
|
||||
return;
|
||||
}
|
||||
$currentWorld = $this->player->getLocation()->getWorld();
|
||||
$currentWorld = $this->player->getLocation()->getWorldNonNull();
|
||||
if($world !== $currentWorld or !$this->player->isUsingChunk($chunkX, $chunkZ)){
|
||||
$this->logger->debug("Tried to send no-longer-active chunk $chunkX $chunkZ in world " . $world->getFolderName());
|
||||
return;
|
||||
|
Reference in New Issue
Block a user