Merge branch 'next-minor' into next-major

This commit is contained in:
Dylan K. Taylor 2023-02-11 17:17:08 +00:00
commit 074e7586cb
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
8 changed files with 87 additions and 52 deletions

@ -1 +1 @@
Subproject commit f51e954743d32aba515a91b2d8b7e6a65e4ac064
Subproject commit fb297eb511862ef3d4ca0aff5256a8caf5513cb4

14
changelogs/4.14.md Normal file
View File

@ -0,0 +1,14 @@
**For Minecraft: Bedrock Edition 1.19.60**
### Note about API versions
Plugins which don't touch the protocol and compatible with any previous 4.x.y version will also run on these releases and do not need API bumps.
Plugin developers should **only** update their required API to this version if you need the changes in this build.
**WARNING: If your plugin uses the protocol, you're not shielded by API change constraints.** You should consider using the `mcpe-protocol` directive in `plugin.yml` as a constraint if you do.
# 4.14.0
Released 8th February 2023.
## General
- Added support for Minecraft: Bedrock Edition 1.19.60.
- Removed support for older versions.

View File

@ -37,7 +37,7 @@
"pocketmine/bedrock-block-upgrade-schema": "^1.0.0",
"pocketmine/bedrock-data": "dev-modern-world-support@dev",
"pocketmine/bedrock-item-upgrade-schema": "^1.0.0",
"pocketmine/bedrock-protocol": "~18.1.0+bedrock-1.19.50",
"pocketmine/bedrock-protocol": "~19.0.0+bedrock-1.19.60",
"pocketmine/binaryutils": "^0.2.1",
"pocketmine/callback-validator": "^1.0.2",
"pocketmine/classloader": "^0.3.0",
@ -55,7 +55,7 @@
"symfony/filesystem": "^5.4"
},
"require-dev": {
"phpstan/phpstan": "1.9.14",
"phpstan/phpstan": "1.9.17",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.2.0",
"phpunit/phpunit": "^9.2"

46
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": "8ab222cb51cdc02aff87dd02a71b6beb",
"content-hash": "627198dc2e7f08e616478e9ca8ce9ae7",
"packages": [
{
"name": "adhocore/json-comment",
@ -280,12 +280,12 @@
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockData.git",
"reference": "6a735f1c6bf11fd100db1de9be029a4e1fd11558"
"reference": "27cb4d5133d6cbe30018b759eb97e3fdc7036c3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/6a735f1c6bf11fd100db1de9be029a4e1fd11558",
"reference": "6a735f1c6bf11fd100db1de9be029a4e1fd11558",
"url": "https://api.github.com/repos/pmmp/BedrockData/zipball/27cb4d5133d6cbe30018b759eb97e3fdc7036c3b",
"reference": "27cb4d5133d6cbe30018b759eb97e3fdc7036c3b",
"shasum": ""
},
"type": "library",
@ -298,7 +298,7 @@
"issues": "https://github.com/pmmp/BedrockData/issues",
"source": "https://github.com/pmmp/BedrockData/tree/modern-world-support"
},
"time": "2023-01-31T23:58:53+00:00"
"time": "2023-02-08T18:33:49+00:00"
},
{
"name": "pocketmine/bedrock-item-upgrade-schema",
@ -328,16 +328,16 @@
},
{
"name": "pocketmine/bedrock-protocol",
"version": "18.1.0+bedrock-1.19.50",
"version": "19.0.0+bedrock-1.19.60",
"source": {
"type": "git",
"url": "https://github.com/pmmp/BedrockProtocol.git",
"reference": "c34f22847a1cc362a3f1c45698576d30d1e8392f"
"reference": "3c8cf08d09b8b3fafc209d184e66e50d2e34c06c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/c34f22847a1cc362a3f1c45698576d30d1e8392f",
"reference": "c34f22847a1cc362a3f1c45698576d30d1e8392f",
"url": "https://api.github.com/repos/pmmp/BedrockProtocol/zipball/3c8cf08d09b8b3fafc209d184e66e50d2e34c06c",
"reference": "3c8cf08d09b8b3fafc209d184e66e50d2e34c06c",
"shasum": ""
},
"require": {
@ -369,9 +369,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/18.1.0+bedrock-1.19.50"
"source": "https://github.com/pmmp/BedrockProtocol/tree/19.0.0+bedrock-1.19.60"
},
"time": "2023-01-20T12:35:30+00:00"
"time": "2023-02-08T18:38:02+00:00"
},
{
"name": "pocketmine/binaryutils",
@ -1775,16 +1775,16 @@
},
{
"name": "phpstan/phpstan",
"version": "1.9.14",
"version": "1.9.17",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e5fcc96289cf737304286a9b505fbed091f02e58"
"reference": "204e459e7822f2c586463029f5ecec31bb45a1f2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5fcc96289cf737304286a9b505fbed091f02e58",
"reference": "e5fcc96289cf737304286a9b505fbed091f02e58",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/204e459e7822f2c586463029f5ecec31bb45a1f2",
"reference": "204e459e7822f2c586463029f5ecec31bb45a1f2",
"shasum": ""
},
"require": {
@ -1814,7 +1814,7 @@
],
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/1.9.14"
"source": "https://github.com/phpstan/phpstan/tree/1.9.17"
},
"funding": [
{
@ -1830,20 +1830,20 @@
"type": "tidelift"
}
],
"time": "2023-01-19T10:47:09+00:00"
"time": "2023-02-08T12:25:00+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
"version": "1.3.3",
"version": "1.3.4",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan-phpunit.git",
"reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7"
"reference": "d77af96c1aaec28f7c0293677132eaaad079e01b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/54a24bd23e9e80ee918cdc24f909d376c2e273f7",
"reference": "54a24bd23e9e80ee918cdc24f909d376c2e273f7",
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d77af96c1aaec28f7c0293677132eaaad079e01b",
"reference": "d77af96c1aaec28f7c0293677132eaaad079e01b",
"shasum": ""
},
"require": {
@ -1880,9 +1880,9 @@
"description": "PHPUnit extensions and rules for PHPStan",
"support": {
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
"source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.3"
"source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.4"
},
"time": "2022-12-21T15:25:00+00:00"
"time": "2023-02-09T08:05:29+00:00"
},
{
"name": "phpstan/phpstan-strict-rules",

View File

@ -51,6 +51,8 @@ use pocketmine\network\mcpe\convert\TypeConverter;
use pocketmine\network\mcpe\protocol\AddPlayerPacket;
use pocketmine\network\mcpe\protocol\PlayerListPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\types\AbilitiesData;
use pocketmine\network\mcpe\protocol\types\AbilitiesLayer;
use pocketmine\network\mcpe\protocol\types\command\CommandPermissions;
use pocketmine\network\mcpe\protocol\types\DeviceOS;
use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
@ -61,7 +63,6 @@ use pocketmine\network\mcpe\protocol\types\GameMode;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\network\mcpe\protocol\types\PlayerPermissions;
use pocketmine\network\mcpe\protocol\types\UpdateAbilitiesPacketLayer;
use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket;
use pocketmine\player\Player;
use pocketmine\utils\Limits;
@ -491,14 +492,14 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
GameMode::SURVIVAL,
$this->getAllNetworkData(),
new PropertySyncData([], []),
UpdateAbilitiesPacket::create(CommandPermissions::NORMAL, PlayerPermissions::VISITOR, $this->getId() /* TODO: this should be unique ID */, [
new UpdateAbilitiesPacketLayer(
UpdateAbilitiesPacketLayer::LAYER_BASE,
array_fill(0, UpdateAbilitiesPacketLayer::NUMBER_OF_ABILITIES, false),
UpdateAbilitiesPacket::create(new AbilitiesData(CommandPermissions::NORMAL, PlayerPermissions::VISITOR, $this->getId() /* TODO: this should be unique ID */, [
new AbilitiesLayer(
AbilitiesLayer::LAYER_BASE,
array_fill(0, AbilitiesLayer::NUMBER_OF_ABILITIES, false),
0.0,
0.0
)
]),
])),
[], //TODO: entity links
"", //device ID (we intentionally don't send this - secvuln)
DeviceOS::UNKNOWN //we intentionally don't send this (secvuln)

View File

@ -90,6 +90,8 @@ use pocketmine\network\mcpe\protocol\TakeItemActorPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\ToastRequestPacket;
use pocketmine\network\mcpe\protocol\TransferPacket;
use pocketmine\network\mcpe\protocol\types\AbilitiesData;
use pocketmine\network\mcpe\protocol\types\AbilitiesLayer;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\command\CommandData;
use pocketmine\network\mcpe\protocol\types\command\CommandEnum;
@ -103,7 +105,6 @@ use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStackWrapper;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\network\mcpe\protocol\types\PlayerPermissions;
use pocketmine\network\mcpe\protocol\types\UpdateAbilitiesPacketLayer;
use pocketmine\network\mcpe\protocol\UpdateAbilitiesPacket;
use pocketmine\network\mcpe\protocol\UpdateAdventureSettingsPacket;
use pocketmine\network\mcpe\protocol\UpdateAttributesPacket;
@ -880,33 +881,33 @@ class NetworkSession{
//ALL of these need to be set for the base layer, otherwise the client will cry
$boolAbilities = [
UpdateAbilitiesPacketLayer::ABILITY_ALLOW_FLIGHT => $for->getAllowFlight(),
UpdateAbilitiesPacketLayer::ABILITY_FLYING => $for->isFlying(),
UpdateAbilitiesPacketLayer::ABILITY_NO_CLIP => !$for->hasBlockCollision(),
UpdateAbilitiesPacketLayer::ABILITY_OPERATOR => $isOp,
UpdateAbilitiesPacketLayer::ABILITY_TELEPORT => $for->hasPermission(DefaultPermissionNames::COMMAND_TELEPORT_SELF),
UpdateAbilitiesPacketLayer::ABILITY_INVULNERABLE => $for->isCreative(),
UpdateAbilitiesPacketLayer::ABILITY_MUTED => false,
UpdateAbilitiesPacketLayer::ABILITY_WORLD_BUILDER => false,
UpdateAbilitiesPacketLayer::ABILITY_INFINITE_RESOURCES => !$for->hasFiniteResources(),
UpdateAbilitiesPacketLayer::ABILITY_LIGHTNING => false,
UpdateAbilitiesPacketLayer::ABILITY_BUILD => !$for->isSpectator(),
UpdateAbilitiesPacketLayer::ABILITY_MINE => !$for->isSpectator(),
UpdateAbilitiesPacketLayer::ABILITY_DOORS_AND_SWITCHES => !$for->isSpectator(),
UpdateAbilitiesPacketLayer::ABILITY_OPEN_CONTAINERS => !$for->isSpectator(),
UpdateAbilitiesPacketLayer::ABILITY_ATTACK_PLAYERS => !$for->isSpectator(),
UpdateAbilitiesPacketLayer::ABILITY_ATTACK_MOBS => !$for->isSpectator(),
AbilitiesLayer::ABILITY_ALLOW_FLIGHT => $for->getAllowFlight(),
AbilitiesLayer::ABILITY_FLYING => $for->isFlying(),
AbilitiesLayer::ABILITY_NO_CLIP => !$for->hasBlockCollision(),
AbilitiesLayer::ABILITY_OPERATOR => $isOp,
AbilitiesLayer::ABILITY_TELEPORT => $for->hasPermission(DefaultPermissionNames::COMMAND_TELEPORT_SELF),
AbilitiesLayer::ABILITY_INVULNERABLE => $for->isCreative(),
AbilitiesLayer::ABILITY_MUTED => false,
AbilitiesLayer::ABILITY_WORLD_BUILDER => false,
AbilitiesLayer::ABILITY_INFINITE_RESOURCES => !$for->hasFiniteResources(),
AbilitiesLayer::ABILITY_LIGHTNING => false,
AbilitiesLayer::ABILITY_BUILD => !$for->isSpectator(),
AbilitiesLayer::ABILITY_MINE => !$for->isSpectator(),
AbilitiesLayer::ABILITY_DOORS_AND_SWITCHES => !$for->isSpectator(),
AbilitiesLayer::ABILITY_OPEN_CONTAINERS => !$for->isSpectator(),
AbilitiesLayer::ABILITY_ATTACK_PLAYERS => !$for->isSpectator(),
AbilitiesLayer::ABILITY_ATTACK_MOBS => !$for->isSpectator(),
];
$this->sendDataPacket(UpdateAbilitiesPacket::create(
$this->sendDataPacket(UpdateAbilitiesPacket::create(new AbilitiesData(
$isOp ? CommandPermissions::OPERATOR : CommandPermissions::NORMAL,
$isOp ? PlayerPermissions::OPERATOR : PlayerPermissions::MEMBER,
$for->getId(),
[
//TODO: dynamic flying speed! FINALLY!!!!!!!!!!!!!!!!!
new UpdateAbilitiesPacketLayer(UpdateAbilitiesPacketLayer::LAYER_BASE, $boolAbilities, 0.05, 0.1),
new AbilitiesLayer(AbilitiesLayer::LAYER_BASE, $boolAbilities, 0.05, 0.1),
]
));
)));
}
public function syncAdventureSettings() : void{

View File

@ -145,6 +145,8 @@ class InGamePacketHandler extends PacketHandler{
public bool $forceMoveSync = false;
protected ?string $lastRequestedFullSkinId = null;
public function __construct(
private Player $player,
private NetworkSession $session,
@ -741,6 +743,15 @@ class InGamePacketHandler extends PacketHandler{
}
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
if($packet->skin->getFullSkinId() === $this->lastRequestedFullSkinId){
//TODO: HACK! In 1.19.60, the client sends its skin back to us if we sent it a skin different from the one
//it's using. We need to prevent this from causing a feedback loop.
$this->session->getLogger()->debug("Refused duplicate skin change request");
return true;
}
$this->lastRequestedFullSkinId = $packet->skin->getFullSkinId();
$this->session->getLogger()->debug("Processing skin change request");
try{
$skin = SkinAdapterSingleton::get()->fromSkinData($packet->skin);
}catch(InvalidSkinException $e){

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\handler;
use pocketmine\network\mcpe\protocol\PlayerAuthInputPacket;
use pocketmine\network\mcpe\protocol\PlayerSkinPacket;
use pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket;
final class SpawnResponsePacketHandler extends PacketHandler{
@ -37,6 +38,13 @@ final class SpawnResponsePacketHandler extends PacketHandler{
return true;
}
public function handlePlayerSkin(PlayerSkinPacket $packet) : bool{
//TODO: REMOVE THIS
//As of 1.19.60, we receive this packet during pre-spawn for no obvious reason. The skin is still sent in the
//login packet, so we can ignore this one. If unhandled, this packet makes a huge debug spam in the log.
return true;
}
public function handlePlayerAuthInput(PlayerAuthInputPacket $packet) : bool{
//the client will send this every tick once we start sending chunks, but we don't handle it in this stage
//this is very spammy so we filter it out