From 4e91009492272b0eefae0ae0813ca115fb62fff5 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 9 Nov 2020 12:47:36 +0000 Subject: [PATCH] Armor: fixed equipping when right-clicking air instead of a block this action (which is more accurately referred to as 'activate item' or 'use item' in other areas) always fires on right-click when holding any item, whether aiming at a block or not. --- src/item/Armor.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/item/Armor.php b/src/item/Armor.php index a3e235ded..804763e65 100644 --- a/src/item/Armor.php +++ b/src/item/Armor.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace pocketmine\item; -use pocketmine\block\Block; use pocketmine\color\Color; use pocketmine\event\entity\EntityDamageEvent; use pocketmine\inventory\ArmorInventory; @@ -122,7 +121,7 @@ class Armor extends Durable{ return 0; } - public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : ItemUseResult{ + public function onClickAir(Player $player, Vector3 $directionVector) : ItemUseResult{ $existing = $player->getArmorInventory()->getItem($this->getArmorSlot()); if(!$existing->isNull()){ return ItemUseResult::FAIL();