Changes for 1.19.20

This commit is contained in:
Dylan K. Taylor 2022-08-09 19:06:05 +01:00
parent d77a95e4af
commit df7a1fcba6
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
7 changed files with 30 additions and 21 deletions

View File

@ -34,8 +34,8 @@
"adhocore/json-comment": "^1.1", "adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3", "fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0", "netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-data": "~1.9.0+bedrock-1.19.10", "pocketmine/bedrock-data": "~1.10.0+bedrock-1.19.20",
"pocketmine/bedrock-protocol": "~11.0.0+bedrock-1.19.10", "pocketmine/bedrock-protocol": "~12.0.0+bedrock-1.19.20",
"pocketmine/binaryutils": "^0.2.1", "pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2", "pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "^0.2.0", "pocketmine/classloader": "^0.2.0",

26
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "f9d81230e16fff707deb5cbe7ff37376", "content-hash": "80afa24adf37096a23643e051d6128ce",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -245,16 +245,16 @@
}, },
{ {
"name": "pocketmine/bedrock-data", "name": "pocketmine/bedrock-data",
"version": "1.9.0+bedrock-1.19.10", "version": "1.10.0+bedrock-1.19.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/BedrockData.git", "url": "https://github.com/pmmp/BedrockData.git",
"reference": "ecd798a3e7ead50b7da73141bbb0c4ba14dd76a1" "reference": "43610f6749f22d15ede6b60ed5402bdeff47453e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/ecd798a3e7ead50b7da73141bbb0c4ba14dd76a1", "url": "https://api.github.com/repos/pmmp/BedrockData/zipball/43610f6749f22d15ede6b60ed5402bdeff47453e",
"reference": "ecd798a3e7ead50b7da73141bbb0c4ba14dd76a1", "reference": "43610f6749f22d15ede6b60ed5402bdeff47453e",
"shasum": "" "shasum": ""
}, },
"type": "library", "type": "library",
@ -265,22 +265,22 @@
"description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP", "description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP",
"support": { "support": {
"issues": "https://github.com/pmmp/BedrockData/issues", "issues": "https://github.com/pmmp/BedrockData/issues",
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.10" "source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.20"
}, },
"time": "2022-07-12T19:33:21+00:00" "time": "2022-08-09T17:44:22+00:00"
}, },
{ {
"name": "pocketmine/bedrock-protocol", "name": "pocketmine/bedrock-protocol",
"version": "11.0.4+bedrock-1.19.10", "version": "12.0.0+bedrock-1.19.20",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git", "url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "1c87aa1187bc7a31b4fc3e1c0f3e22251c2e6eab" "reference": "c2778039544fa0c7c5bd3af7963149e7552f4215"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/1c87aa1187bc7a31b4fc3e1c0f3e22251c2e6eab", "url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/c2778039544fa0c7c5bd3af7963149e7552f4215",
"reference": "1c87aa1187bc7a31b4fc3e1c0f3e22251c2e6eab", "reference": "c2778039544fa0c7c5bd3af7963149e7552f4215",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -312,9 +312,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP", "description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": { "support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues", "issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/11.0.4+bedrock-1.19.10" "source": "https://github.com/pmmp/BedrockProtocol/tree/bedrock-1.19.20"
}, },
"time": "2022-07-24T19:22:18+00:00" "time": "2022-08-09T17:57:29+00:00"
}, },
{ {
"name": "pocketmine/binaryutils", "name": "pocketmine/binaryutils",

View File

@ -1466,7 +1466,7 @@ abstract class Entity{
$this->location->yaw, //TODO: head yaw $this->location->yaw, //TODO: head yaw
$this->location->yaw, //TODO: body yaw (wtf mojang?) $this->location->yaw, //TODO: body yaw (wtf mojang?)
array_map(function(Attribute $attr) : NetworkAttribute{ array_map(function(Attribute $attr) : NetworkAttribute{
return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue()); return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue(), []);
}, $this->attributeMap->getAll()), }, $this->attributeMap->getAll()),
$this->getAllNetworkData(), $this->getAllNetworkData(),
[] //TODO: entity links [] //TODO: entity links

View File

@ -30,6 +30,7 @@ use pocketmine\network\mcpe\convert\RuntimeBlockMapping;
use pocketmine\network\mcpe\protocol\LevelChunkPacket; use pocketmine\network\mcpe\protocol\LevelChunkPacket;
use pocketmine\network\mcpe\protocol\serializer\PacketBatch; use pocketmine\network\mcpe\protocol\serializer\PacketBatch;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializerContext; use pocketmine\network\mcpe\protocol\serializer\PacketSerializerContext;
use pocketmine\network\mcpe\protocol\types\ChunkPosition;
use pocketmine\network\mcpe\serializer\ChunkSerializer; use pocketmine\network\mcpe\serializer\ChunkSerializer;
use pocketmine\scheduler\AsyncTask; use pocketmine\scheduler\AsyncTask;
use pocketmine\world\format\Chunk; use pocketmine\world\format\Chunk;
@ -71,7 +72,7 @@ class ChunkRequestTask extends AsyncTask{
$subCount = ChunkSerializer::getSubChunkCount($chunk) + ChunkSerializer::LOWER_PADDING_SIZE; $subCount = ChunkSerializer::getSubChunkCount($chunk) + ChunkSerializer::LOWER_PADDING_SIZE;
$encoderContext = new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary()); $encoderContext = new PacketSerializerContext(GlobalItemTypeDictionary::getInstance()->getDictionary());
$payload = ChunkSerializer::serializeFullChunk($chunk, RuntimeBlockMapping::getInstance(), $encoderContext, $this->tiles); $payload = ChunkSerializer::serializeFullChunk($chunk, RuntimeBlockMapping::getInstance(), $encoderContext, $this->tiles);
$this->setResult($this->compressor->compress(PacketBatch::fromPackets($encoderContext, LevelChunkPacket::create($this->chunkX, $this->chunkZ, $subCount, false, null, $payload))->getBuffer())); $this->setResult($this->compressor->compress(PacketBatch::fromPackets($encoderContext, LevelChunkPacket::create(new ChunkPosition($this->chunkX, $this->chunkZ), $subCount, false, null, $payload))->getBuffer()));
} }
public function onError() : void{ public function onError() : void{

View File

@ -756,7 +756,7 @@ class NetworkSession{
} }
public function syncViewAreaCenterPoint(Vector3 $newPos, int $viewDistance) : void{ public function syncViewAreaCenterPoint(Vector3 $newPos, int $viewDistance) : void{
$this->sendDataPacket(NetworkChunkPublisherUpdatePacket::create(BlockPosition::fromVector3($newPos), $viewDistance * 16)); //blocks, not chunks >.> $this->sendDataPacket(NetworkChunkPublisherUpdatePacket::create(BlockPosition::fromVector3($newPos), $viewDistance * 16, [])); //blocks, not chunks >.>
} }
public function syncPlayerSpawnPoint(Position $newSpawn) : void{ public function syncPlayerSpawnPoint(Position $newSpawn) : void{
@ -834,7 +834,7 @@ class NetworkSession{
public function syncAttributes(Living $entity, array $attributes) : void{ public function syncAttributes(Living $entity, array $attributes) : void{
if(count($attributes) > 0){ if(count($attributes) > 0){
$this->sendDataPacket(UpdateAttributesPacket::create($entity->getId(), array_map(function(Attribute $attr) : NetworkAttribute{ $this->sendDataPacket(UpdateAttributesPacket::create($entity->getId(), array_map(function(Attribute $attr) : NetworkAttribute{
return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue()); return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue(), []);
}, $attributes), 0)); }, $attributes), 0));
} }
} }

View File

@ -890,7 +890,14 @@ class InGamePacketHandler extends PacketHandler{
} }
public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{ public function handleModalFormResponse(ModalFormResponsePacket $packet) : bool{
if($packet->cancelReason !== null){
//TODO: make APIs for this to allow plugins to use this information
return $this->player->onFormSubmit($packet->formId, null);
}elseif($packet->formData !== null){
return $this->player->onFormSubmit($packet->formId, self::stupid_json_decode($packet->formData, true)); return $this->player->onFormSubmit($packet->formId, self::stupid_json_decode($packet->formData, true));
}else{
throw new PacketHandlingException("Expected either formData or cancelReason to be set in ModalFormResponsePacket");
}
} }
/** /**

View File

@ -98,9 +98,10 @@ class PreSpawnPacketHandler extends PacketHandler{
false, false,
sprintf("%s %s", VersionInfo::NAME, VersionInfo::VERSION()->getFullVersion(true)), sprintf("%s %s", VersionInfo::NAME, VersionInfo::VERSION()->getFullVersion(true)),
Uuid::fromString(Uuid::NIL), Uuid::fromString(Uuid::NIL),
false,
[], [],
0, 0,
GlobalItemTypeDictionary::getInstance()->getDictionary()->getEntries() GlobalItemTypeDictionary::getInstance()->getDictionary()->getEntries(),
)); ));
$this->session->sendDataPacket(StaticPacketCache::getInstance()->getAvailableActorIdentifiers()); $this->session->sendDataPacket(StaticPacketCache::getInstance()->getAvailableActorIdentifiers());