PocketMine-MP 5.40.1 git-25718e8ccd903d1408fb25666ef84028379bbea6
Loading...
Searching...
No Matches
GatheringJoinInfo.php
1<?php
2
3/*
4 * This file is part of BedrockProtocol.
5 * Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6 *
7 * BedrockProtocol is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 */
12
13declare(strict_types=1);
14
15namespace pocketmine\network\mcpe\protocol\types;
16
17use pmmp\encoding\ByteBufferReader;
18use pmmp\encoding\ByteBufferWriter;
20
22
23 public function __construct(
24 private string $experienceId,
25 private string $experienceName,
26 private string $experienceWorldId,
27 private string $experienceWorldName,
28 private string $creatorId,
29 private string $storeId,
30 ){}
31
32 public function getExperienceId() : string{ return $this->experienceId; }
33
34 public function getExperienceName() : string{ return $this->experienceName; }
35
36 public function getExperienceWorldId() : string{ return $this->experienceWorldId; }
37
38 public function getExperienceWorldName() : string{ return $this->experienceWorldName; }
39
40 public function getCreatorId() : string{ return $this->creatorId; }
41
42 public function getStoreId() : string{ return $this->storeId; }
43
44 public static function read(ByteBufferReader $in) : self{
45 $experienceId = CommonTypes::getString($in);
46 $experienceName = CommonTypes::getString($in);
47 $experienceWorldId = CommonTypes::getString($in);
48 $experienceWorldName = CommonTypes::getString($in);
49 $creatorId = CommonTypes::getString($in);
50 $storeId = CommonTypes::getString($in);
51
52 return new self(
53 $experienceId,
54 $experienceName,
55 $experienceWorldId,
56 $experienceWorldName,
57 $creatorId,
58 $storeId
59 );
60 }
61
62 public function write(ByteBufferWriter $out) : void{
63 CommonTypes::putString($out, $this->experienceId);
64 CommonTypes::putString($out, $this->experienceName);
65 CommonTypes::putString($out, $this->experienceWorldId);
66 CommonTypes::putString($out, $this->experienceWorldName);
67 CommonTypes::putString($out, $this->creatorId);
68 CommonTypes::putString($out, $this->storeId);
69 }
70}