player = $player; $this->session = $session; } public function setUp() : void{ $pk = new RespawnPacket(); $pk->position = $this->player->getOffsetPosition($this->player->getSpawn()); $this->session->sendDataPacket($pk); } public function handlePlayerAction(PlayerActionPacket $packet) : bool{ switch($packet->action){ case PlayerActionPacket::ACTION_RESPAWN: $this->player->respawn(); return true; case PlayerActionPacket::ACTION_DIMENSION_CHANGE_REQUEST: //TODO: players send this when they die in another dimension break; } return false; } }