forked from pmmp/BedrockProtocol
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5984bbd
commit de482bc
Showing
36 changed files
with
744 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of BedrockProtocol. | ||
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol> | ||
* | ||
* BedrockProtocol is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace pocketmine\network\mcpe\protocol; | ||
|
||
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; | ||
|
||
class ClientboundCloseFormPacket extends DataPacket implements ClientboundPacket{ | ||
public const NETWORK_ID = ProtocolInfo::CLIENTBOUND_CLOSE_FORM_PACKET; | ||
|
||
/** | ||
* @generate-create-func | ||
*/ | ||
public static function create() : self{ | ||
return new self; | ||
} | ||
|
||
protected function decodePayload(PacketSerializer $in) : void{ | ||
//No payload | ||
} | ||
|
||
protected function encodePayload(PacketSerializer $out) : void{ | ||
//No payload | ||
} | ||
|
||
public function handle(PacketHandlerInterface $handler) : bool{ | ||
return $handler->handleClientboundCloseForm($this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of BedrockProtocol. | ||
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol> | ||
* | ||
* BedrockProtocol is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace pocketmine\network\mcpe\protocol; | ||
|
||
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; | ||
|
||
class CurrentStructureFeaturePacket extends DataPacket implements ClientboundPacket{ | ||
public const NETWORK_ID = ProtocolInfo::CURRENT_STRUCTURE_FEATURE_PACKET; | ||
|
||
public string $currentStructureFeature; | ||
|
||
/** | ||
* @generate-create-func | ||
*/ | ||
public static function create(string $currentStructureFeature) : self{ | ||
$result = new self; | ||
$result->currentStructureFeature = $currentStructureFeature; | ||
return $result; | ||
} | ||
|
||
protected function decodePayload(PacketSerializer $in) : void{ | ||
$this->currentStructureFeature = $in->getString(); | ||
} | ||
|
||
protected function encodePayload(PacketSerializer $out) : void{ | ||
$out->putString($this->currentStructureFeature); | ||
} | ||
|
||
public function handle(PacketHandlerInterface $handler) : bool{ | ||
return $handler->handleCurrentStructureFeature($this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of BedrockProtocol. | ||
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol> | ||
* | ||
* BedrockProtocol is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace pocketmine\network\mcpe\protocol; | ||
|
||
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer; | ||
use pocketmine\network\mcpe\protocol\types\CacheableNbt; | ||
|
||
class JigsawStructureDataPacket extends DataPacket implements ClientboundPacket{ | ||
public const NETWORK_ID = ProtocolInfo::JIGSAW_STRUCTURE_DATA_PACKET; | ||
|
||
/** @phpstan-var CacheableNbt<\pocketmine\nbt\tag\CompoundTag> */ | ||
private CacheableNbt $nbt; | ||
|
||
/** | ||
* @generate-create-func | ||
* @phpstan-param CacheableNbt<\pocketmine\nbt\tag\CompoundTag> $nbt | ||
*/ | ||
public static function create(CacheableNbt $nbt) : self{ | ||
$result = new self; | ||
$result->nbt = $nbt; | ||
return $result; | ||
} | ||
|
||
/** @phpstan-return CacheableNbt<\pocketmine\nbt\tag\CompoundTag> */ | ||
public function getNbt() : CacheableNbt{ return $this->nbt; } | ||
|
||
protected function decodePayload(PacketSerializer $in) : void{ | ||
$this->nbt = new CacheableNbt($in->getNbtCompoundRoot()); | ||
} | ||
|
||
protected function encodePayload(PacketSerializer $out) : void{ | ||
$out->put($this->nbt->getEncodedNbt()); | ||
} | ||
|
||
public function handle(PacketHandlerInterface $handler) : bool{ | ||
return $handler->handleJigsawStructureData($this); | ||
} | ||
} |
Oops, something went wrong.