NetworkSession: renamed some instructions to imperative instead of onWhatever()

these aren't listening to events, they are telling the client that an event has taken place.
This commit is contained in:
Dylan K. Taylor 2020-10-06 18:06:48 +01:00
parent 945a2598b7
commit 15eac8a65a
2 changed files with 4 additions and 4 deletions

View File

@ -610,11 +610,11 @@ class NetworkSession{
$this->logger->debug("Initiating resource packs phase"); $this->logger->debug("Initiating resource packs phase");
$this->setHandler(new ResourcePacksPacketHandler($this, $this->server->getResourcePackManager(), function() : void{ $this->setHandler(new ResourcePacksPacketHandler($this, $this->server->getResourcePackManager(), function() : void{
$this->onResourcePacksDone(); $this->beginSpawnSequence();
})); }));
} }
private function onResourcePacksDone() : void{ private function beginSpawnSequence() : void{
$this->createPlayer(); $this->createPlayer();
$this->setHandler(new PreSpawnPacketHandler($this->server, $this->player, $this)); $this->setHandler(new PreSpawnPacketHandler($this->server, $this->player, $this));
@ -623,7 +623,7 @@ class NetworkSession{
$this->logger->debug("Waiting for spawn chunks"); $this->logger->debug("Waiting for spawn chunks");
} }
public function onTerrainReady() : void{ public function notifyTerrainReady() : void{
$this->logger->debug("Sending spawn notification, waiting for spawn response"); $this->logger->debug("Sending spawn notification, waiting for spawn response");
$this->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::PLAYER_SPAWN)); $this->sendDataPacket(PlayStatusPacket::create(PlayStatusPacket::PLAYER_SPAWN));
$this->setHandler(new SpawnResponsePacketHandler(function() : void{ $this->setHandler(new SpawnResponsePacketHandler(function() : void{

View File

@ -790,7 +790,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
} }
} }
$this->networkSession->onTerrainReady(); $this->networkSession->notifyTerrainReady();
} }
}); });
} }