mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
NetworkSession: Fixed InventoryManager nullability disaster
fixes #4277 fixes #4275 fixes #3139
This commit is contained in:
@@ -672,7 +672,7 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
private function beginSpawnSequence() : void{
|
||||
$this->setHandler(new PreSpawnPacketHandler($this->server, $this->player, $this));
|
||||
$this->setHandler(new PreSpawnPacketHandler($this->server, $this->player, $this, $this->invManager));
|
||||
$this->player->setImmobile(); //TODO: HACK: fix client-side falling pre-spawn
|
||||
|
||||
$this->logger->debug("Waiting for chunk radius request");
|
||||
@@ -691,7 +691,7 @@ class NetworkSession{
|
||||
$this->player->setImmobile(false); //TODO: HACK: we set this during the spawn sequence to prevent the client sending junk movements
|
||||
$this->player->doFirstSpawn();
|
||||
$this->forceAsyncCompression = false;
|
||||
$this->setHandler(new InGamePacketHandler($this->player, $this));
|
||||
$this->setHandler(new InGamePacketHandler($this->player, $this, $this->invManager));
|
||||
}
|
||||
|
||||
public function onServerDeath() : void{
|
||||
@@ -705,7 +705,7 @@ class NetworkSession{
|
||||
|
||||
$this->syncAdventureSettings($this->player);
|
||||
$this->invManager->syncAll();
|
||||
$this->setHandler(new InGamePacketHandler($this->player, $this));
|
||||
$this->setHandler(new InGamePacketHandler($this->player, $this, $this->invManager));
|
||||
}
|
||||
|
||||
public function syncMovement(Vector3 $pos, ?float $yaw = null, ?float $pitch = null, int $mode = MovePlayerPacket::MODE_NORMAL) : void{
|
||||
@@ -937,7 +937,7 @@ class NetworkSession{
|
||||
$this->sendDataPacket(SetDifficultyPacket::create($worldDifficulty));
|
||||
}
|
||||
|
||||
public function getInvManager() : InventoryManager{
|
||||
public function getInvManager() : ?InventoryManager{
|
||||
return $this->invManager;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user