From 4bf9fb278b8d33903f40a2cc9c8c6a99552716be Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2020 13:31:23 +0000 Subject: [PATCH 1/4] Bump phpstan/phpstan from 0.12.11 to 0.12.14 (#3338) --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 7dd115e86..9e87c7c4b 100644 --- a/composer.lock +++ b/composer.lock @@ -436,16 +436,16 @@ }, { "name": "phpstan/phpstan", - "version": "0.12.11", + "version": "0.12.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "ca5f2b7cf81c6d8fba74f9576970399c5817e03b" + "reference": "37bdd26a80235d0f9045b49f4151102b7831cbe2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ca5f2b7cf81c6d8fba74f9576970399c5817e03b", - "reference": "ca5f2b7cf81c6d8fba74f9576970399c5817e03b", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/37bdd26a80235d0f9045b49f4151102b7831cbe2", + "reference": "37bdd26a80235d0f9045b49f4151102b7831cbe2", "shasum": "" }, "require": { @@ -471,7 +471,7 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2020-02-16T14:00:29+00:00" + "time": "2020-03-02T22:29:43+00:00" }, { "name": "phpstan/phpstan-phpunit", From a6ca37429ccef1953f8112c19b63b09515ff1175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Arias?= Date: Mon, 9 Mar 2020 14:45:58 +0100 Subject: [PATCH 2/4] Player: do not set held item post block-break if changed (#3345) this usually happens when a plugin replaces the held item during BlockBreakEvent. closes #2010 --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 9b59586ff..0021ef6fd 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2420,7 +2420,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ if($this->canInteract($blockVector->add(0.5, 0.5, 0.5), $this->isCreative() ? 13 : 7) and $this->level->useBreakOn($blockVector, $item, $this, true)){ if($this->isSurvival()){ - if(!$item->equalsExact($oldItem)){ + if(!$item->equalsExact($oldItem) and $oldItem->equalsExact($this->inventory->getItemInHand())){ $this->inventory->setItemInHand($item); $this->inventory->sendHeldItem($this->hasSpawned); } From 89ea7f0a769014a12cfaffcb85b668a96730f7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Arias?= Date: Tue, 10 Mar 2020 11:09:31 +0100 Subject: [PATCH 3/4] Player: Stop setting held item post entity attack if changed (#3348) closes #3340 --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 0021ef6fd..1c029855d 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2590,7 +2590,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ if($this->isAlive()){ //reactive damage like thorns might cause us to be killed by attacking another mob, which //would mean we'd already have dropped the inventory by the time we reached here - if($heldItem->onAttackEntity($target) and $this->isSurvival()){ //always fire the hook, even if we are survival + if($heldItem->onAttackEntity($target) and $this->isSurvival() and $heldItem->equalsExact($this->inventory->getItemInHand())){ //always fire the hook, even if we are survival $this->inventory->setItemInHand($heldItem); } From a72e6ee706b4eeb13aca1d407646dc15f753bafa Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 10 Mar 2020 12:10:01 +0000 Subject: [PATCH 4/4] Player: be aware of held item changing during click-block this caused bugs if the inventory was cleared while using a hoe. --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 1c029855d..4c67b99ce 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -2388,7 +2388,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $item = $this->inventory->getItemInHand(); $oldItem = clone $item; if($this->level->useItemOn($blockVector, $item, $face, $packet->trData->clickPos, $this, true)){ - if(!$item->equalsExact($oldItem)){ + if(!$item->equalsExact($oldItem) and $oldItem->equalsExact($this->inventory->getItemInHand())){ $this->inventory->setItemInHand($item); $this->inventory->sendHeldItem($this->hasSpawned); }