1.19.0 changes

This commit is contained in:
Dylan K. Taylor 2022-06-07 17:47:13 +01:00
parent ce66a400a7
commit 016a80bb70
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 45 additions and 33 deletions

View File

@ -34,8 +34,8 @@
"adhocore/json-comment": "^1.1",
"fgrosse/phpasn1": "^2.3",
"netresearch/jsonmapper": "^4.0",
"pocketmine/bedrock-data": "~1.7.0+bedrock-1.18.30",
"pocketmine/bedrock-protocol": "~9.0.0+bedrock-1.18.30",
"pocketmine/bedrock-data": "~1.8.0+bedrock-1.19.0",
"pocketmine/bedrock-protocol": "~10.0.0+bedrock-1.19.0",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "^0.2.0",

28
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1e967ff64cee3cae84242cc3e5a51752",
"content-hash": "363ffec55c206510b591b54f10138fc0",
"packages": [
{
"name": "adhocore/json-comment",
@ -249,16 +249,16 @@
},
{
"name": "pocketmine/bedrock-data",
"version": "1.7.0+bedrock-1.18.30",
"version": "1.8.0+bedrock-1.19.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockData.git",
"reference": "c8f323ff0cbdb36a5d95e7e4a23969f562445be0"
"reference": "e654d0a6e5dfd55f8546097ea629c528a70c30ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/c8f323ff0cbdb36a5d95e7e4a23969f562445be0",
"reference": "c8f323ff0cbdb36a5d95e7e4a23969f562445be0",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/e654d0a6e5dfd55f8546097ea629c528a70c30ee",
"reference": "e654d0a6e5dfd55f8546097ea629c528a70c30ee",
"shasum": ""
},
"type": "library",
@ -269,22 +269,22 @@
"description": "Blobs of data generated from Minecraft: Bedrock Edition, used by PocketMine-MP",
"support": {
"issues": "https://github.com/pmmp/BedrockData/issues",
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.18.30"
"source": "https://github.com/pmmp/BedrockData/tree/bedrock-1.19.0"
},
"time": "2022-04-20T12:40:59+00:00"
"time": "2022-06-07T16:20:20+00:00"
},
{
"name": "pocketmine/bedrock-protocol",
"version": "9.0.2+bedrock-1.18.30",
"version": "10.0.0+bedrock-1.19.0",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "37f1cd017caf7aaaa90330ee54690098283589cb"
"reference": "7c17498541bb9a375b945cb131e951674067c00e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/37f1cd017caf7aaaa90330ee54690098283589cb",
"reference": "37f1cd017caf7aaaa90330ee54690098283589cb",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/7c17498541bb9a375b945cb131e951674067c00e",
"reference": "7c17498541bb9a375b945cb131e951674067c00e",
"shasum": ""
},
"require": {
@ -298,7 +298,7 @@
"ramsey/uuid": "^4.1"
},
"require-dev": {
"phpstan/phpstan": "1.7.4",
"phpstan/phpstan": "1.7.11",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpstan/phpstan-strict-rules": "^1.0.0",
"phpunit/phpunit": "^9.5"
@ -316,9 +316,9 @@
"description": "An implementation of the Minecraft: Bedrock Edition protocol in PHP",
"support": {
"issues": "https://github.com/pmmp/BedrockProtocol/issues",
"source": "https://github.com/pmmp/BedrockProtocol/tree/9.0.2+bedrock-1.18.30"
"source": "https://github.com/pmmp/BedrockProtocol/tree/10.0.0+bedrock-1.19.0"
},
"time": "2022-05-30T15:09:53+00:00"
"time": "2022-06-07T16:31:30+00:00"
},
{
"name": "pocketmine/binaryutils",

View File

@ -80,6 +80,7 @@ use pocketmine\network\mcpe\protocol\PlayerAuthInputPacket;
use pocketmine\network\mcpe\protocol\PlayerHotbarPacket;
use pocketmine\network\mcpe\protocol\PlayerInputPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\RequestAbilityPacket;
use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
use pocketmine\network\mcpe\protocol\ServerSettingsRequestPacket;
use pocketmine\network\mcpe\protocol\SetActorMotionPacket;
@ -114,6 +115,7 @@ use function count;
use function fmod;
use function implode;
use function in_array;
use function is_bool;
use function is_infinite;
use function is_nan;
use function json_decode;
@ -610,6 +612,9 @@ class InGamePacketHandler extends PacketHandler{
case PlayerAction::CREATIVE_PLAYER_DESTROY_BLOCK:
//TODO: do we need to handle this?
break;
case PlayerAction::START_ITEM_USE_ON:
case PlayerAction::STOP_ITEM_USE_ON:
//TODO: this has no obvious use and seems only used for analytics in vanilla - ignore it
default:
$this->session->getLogger()->debug("Unhandled/unknown player action type " . $action);
return false;
@ -642,23 +647,7 @@ class InGamePacketHandler extends PacketHandler{
}
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
if($packet->targetActorUniqueId !== $this->player->getId()){
return false; //TODO: operators can change other people's permissions using this
}
$handled = false;
$isFlying = $packet->getFlag(AdventureSettingsPacket::FLYING);
if($isFlying !== $this->player->isFlying()){
if(!$this->player->toggleFlight($isFlying)){
$this->session->syncAdventureSettings($this->player);
}
$handled = true;
}
//TODO: check for other changes
return $handled;
return true; //no longer used, but the client still sends it for flight changes
}
public function handleBlockActorData(BlockActorDataPacket $packet) : bool{
@ -980,4 +969,22 @@ class InGamePacketHandler extends PacketHandler{
$this->player->emote($packet->getEmoteId());
return true;
}
public function handleRequestAbility(RequestAbilityPacket $packet) : bool{
if($packet->getAbilityId() === RequestAbilityPacket::ABILITY_FLYING){
$isFlying = $packet->getAbilityValue();
if(!is_bool($isFlying)){
throw new PacketHandlingException("Flying ability should always have a bool value");
}
if($isFlying !== $this->player->isFlying()){
if(!$this->player->toggleFlight($isFlying)){
$this->session->syncAdventureSettings($this->player);
}
}
return true;
}
return false;
}
}

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\handler;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\cache\CraftingDataCache;
use pocketmine\network\mcpe\cache\StaticPacketCache;
use pocketmine\network\mcpe\convert\GlobalItemTypeDictionary;
@ -33,6 +34,7 @@ use pocketmine\network\mcpe\protocol\RequestChunkRadiusPacket;
use pocketmine\network\mcpe\protocol\StartGamePacket;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\BoolGameRule;
use pocketmine\network\mcpe\protocol\types\CacheableNbt;
use pocketmine\network\mcpe\protocol\types\DimensionIds;
use pocketmine\network\mcpe\protocol\types\Experiments;
use pocketmine\network\mcpe\protocol\types\LevelSettings;
@ -42,6 +44,7 @@ use pocketmine\network\mcpe\protocol\types\SpawnSettings;
use pocketmine\player\Player;
use pocketmine\Server;
use pocketmine\VersionInfo;
use Ramsey\Uuid\Uuid;
use function sprintf;
/**
@ -82,6 +85,7 @@ class PreSpawnPacketHandler extends PacketHandler{
$this->player->getOffsetPosition($location),
$location->pitch,
$location->yaw,
new CacheableNbt(CompoundTag::create()), //TODO: we don't care about this right now
$levelSettings,
"",
$this->server->getMotd(),
@ -93,6 +97,7 @@ class PreSpawnPacketHandler extends PacketHandler{
"",
false,
sprintf("%s %s", VersionInfo::NAME, VersionInfo::VERSION()->getFullVersion(true)),
Uuid::fromString(Uuid::NIL),
[],
0,
GlobalItemTypeDictionary::getInstance()->getDictionary()->getEntries()