Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-02-19 20:16:49 +00:00
commit 3ed336fa0e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
6 changed files with 23 additions and 20 deletions

View File

@ -13,11 +13,11 @@ jobs:
strategy:
matrix:
image: [ubuntu-20.04]
php: [8.0.14]
php: [8.0.16]
steps:
- name: Build and prepare PHP cache
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
@ -31,13 +31,13 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.14]
php: [8.0.16]
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
@ -69,13 +69,13 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.14]
php: [8.0.16]
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
@ -107,7 +107,7 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.14]
php: [8.0.16]
steps:
- uses: actions/checkout@v2
@ -115,7 +115,7 @@ jobs:
submodules: true
- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440
with:
php-version: ${{ matrix.php }}
install-path: "./bin"
@ -147,13 +147,13 @@ jobs:
fail-fast: false
matrix:
image: [ubuntu-20.04]
php: [8.0.14]
php: [8.0.16]
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: pmmp/setup-php-action@aa636a4fe0c1c035fd9a3f05e360eadd86e06440
with:
php-version: ${{ matrix.php }}
install-path: "./bin"

View File

@ -413,6 +413,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
### Command
- The following classes have been removed:
- `PluginIdentifiableCommand` - use `PluginOwned` and `PluginOwnedTrait`
- `RemoteConsoleCommandSender`
- The following API methods have signature changes:
- `Command->setPermission()` argument is now mandatory (but still nullable).
@ -1054,6 +1055,7 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
- `Player->addWindow()`: use `Player->setCurrentWindow()` instead
- `Player->dataPacket()`: replaced by `NetworkSession->sendDataPacket()`
- `Player->getAddress()`: replaced by `NetworkSession->getIp()`
- `Player->getClientId()`: the client ID can be found in `PlayerInfo->getExtraData()`
- `Player->getPing()`: moved to `NetworkSession`
- `Player->getPort()`: moved to `NetworkSession`
- `Player->getWindow()`: use `Player->getCurrentWindow()` instead
@ -1069,6 +1071,8 @@ However, if we add `src-namespace-prefix: pmmp\TesterPlugin` to the `plugin.yml`
- API version checks are now more strict. It is no longer legal to declare multiple minimum versions on the same major version. Doing so will now cause the plugin to fail to load with the message `Multiple minimum API versions found for some major versions`.
- `plugin.yml` YAML commands loading is now internalized inside `PluginBase`.
- `PluginManager->registerEvent()` now has a simpler signature: `registerEvent(string $event, \Closure $handler, int $priority, Plugin $plugin, bool $handleCancelled = false)`. The provided closure must accept the specified event class as its only parameter. See [Event API changes](#event) for more details.
- The following classes have been added:
- `PluginOwned`
- The following classes have been removed:
- `PluginLogger`
- The following constants have been removed:

View File

@ -166,7 +166,7 @@ class Bed extends Transparent{
}
public function onNearbyBlockChange() : void{
if(($other = $this->getOtherHalf()) !== null && $other->occupied !== $this->occupied){
if(!$this->head && ($other = $this->getOtherHalf()) !== null && $other->occupied !== $this->occupied){
$this->occupied = $other->occupied;
$this->position->getWorld()->setBlock($this->position, $this);
}

View File

@ -659,8 +659,9 @@ class Item implements \JsonSerializable{
->setByte("Count", Binary::signByte($this->count))
->setShort("Damage", $this->getMeta());
if($this->hasNamedTag()){
$result->setTag("tag", $this->getNamedTag());
$tag = $this->getNamedTag();
if($tag->count() > 0){
$result->setTag("tag", $tag);
}
if($slot !== -1){

View File

@ -124,12 +124,14 @@ use function count;
use function get_class;
use function in_array;
use function json_encode;
use function ksort;
use function strlen;
use function strtolower;
use function substr;
use function time;
use function ucfirst;
use const JSON_THROW_ON_ERROR;
use const SORT_NUMERIC;
class NetworkSession{
private \PrefixedLogger $logger;
@ -821,6 +823,9 @@ class NetworkSession{
* @phpstan-param array<int, MetadataProperty> $properties
*/
public function syncActorData(Entity $entity, array $properties) : void{
//TODO: HACK! as of 1.18.10, the client responds differently to the same data ordered in different orders - for
//example, sending HEIGHT in the list before FLAGS when unsetting the SWIMMING flag results in a hitbox glitch
ksort($properties, SORT_NUMERIC);
$this->sendDataPacket(SetActorDataPacket::create($entity->getId(), $properties, 0));
}

View File

@ -90,8 +90,6 @@ use pocketmine\network\mcpe\protocol\SubClientLoginPacket;
use pocketmine\network\mcpe\protocol\TextPacket;
use pocketmine\network\mcpe\protocol\types\ActorEvent;
use pocketmine\network\mcpe\protocol\types\BlockPosition;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\network\mcpe\protocol\types\entity\FloatMetadataProperty;
use pocketmine\network\mcpe\protocol\types\inventory\ContainerIds;
use pocketmine\network\mcpe\protocol\types\inventory\MismatchTransactionData;
use pocketmine\network\mcpe\protocol\types\inventory\NetworkInventoryAction;
@ -224,11 +222,6 @@ class InGamePacketHandler extends PacketHandler{
($gliding !== null && !$this->player->toggleGlide($gliding));
if((bool) $mismatch){
$this->player->sendData([$this->player]);
}elseif($packet->hasFlag(PlayerAuthInputFlags::STOP_SWIMMING) || $packet->hasFlag(PlayerAuthInputFlags::STOP_GLIDING)){
//TODO: HACK! workaround for a client bug where the AABB doesn't change back properly when stopping swimming or gliding
$this->player->sendData([$this->player], [
EntityMetadataProperties::BOUNDING_BOX_HEIGHT => new FloatMetadataProperty($this->player->getSize()->getHeight())
]);
}
if($packet->hasFlag(PlayerAuthInputFlags::START_JUMPING)){