From 4ad8cb02a5bb99bbd89eed49c0f9c16f331e67a5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Dec 2021 17:36:25 +0000 Subject: [PATCH 1/3] BlockIdentifier: ensure that the tile class given is valid --- src/block/BlockIdentifier.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/block/BlockIdentifier.php b/src/block/BlockIdentifier.php index 5ea45c90b..b69037ad0 100644 --- a/src/block/BlockIdentifier.php +++ b/src/block/BlockIdentifier.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace pocketmine\block; use pocketmine\block\tile\Tile; +use pocketmine\utils\Utils; class BlockIdentifier{ @@ -40,6 +41,10 @@ class BlockIdentifier{ $this->blockId = $blockId; $this->variant = $variant; $this->itemId = $itemId; + + if($tileClass !== null){ + Utils::testValidInstance($tileClass, Tile::class); + } $this->tileClass = $tileClass; } From 45c4a9673ddd536db814a7b6bdfcfdc21d8d6ad5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Dec 2021 19:03:42 +0000 Subject: [PATCH 2/3] Player: fixed arm swing animation not showing during attack cooldown of victim closes #4650 --- src/player/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player/Player.php b/src/player/Player.php index aab421014..d431f430e 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1667,13 +1667,13 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ } $entity->attack($ev); + $this->broadcastAnimation(new ArmSwingAnimation($this), $this->getViewers()); $soundPos = $entity->getPosition()->add(0, $entity->size->getHeight() / 2, 0); if($ev->isCancelled()){ $this->getWorld()->addSound($soundPos, new EntityAttackNoDamageSound()); return false; } - $this->broadcastAnimation(new ArmSwingAnimation($this), $this->getViewers()); $this->getWorld()->addSound($soundPos, new EntityAttackSound()); if($ev->getModifier(EntityDamageEvent::MODIFIER_CRITICAL) > 0 and $entity instanceof Living){ From a09817864b0d05f7aadb32211e962b66045e7ebb Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 14 Dec 2021 22:50:43 +0000 Subject: [PATCH 3/3] php-cs-fixer: add return_type_declaration space_before --- .php-cs-fixer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 590f6ebd8..aa00fc033 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -69,6 +69,9 @@ return (new PhpCsFixer\Config) ], 'phpdoc_trim' => true, 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'return_type_declaration' => [ + 'space_before' => 'one' + ], 'single_import_per_statement' => true, 'strict_param' => true, ])