From 8c8794ec71279e395caa76d2b6fa751c0f903aa1 Mon Sep 17 00:00:00 2001 From: IvanCraft623 <57236932+IvanCraft623@users.noreply.github.com> Date: Fri, 14 Jul 2023 11:41:46 -0500 Subject: [PATCH] Allow use ConsumingItemAnimation with Living entities (#5897) --- src/entity/animation/ConsumingItemAnimation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/entity/animation/ConsumingItemAnimation.php b/src/entity/animation/ConsumingItemAnimation.php index aa6152a57..49c8a0a51 100644 --- a/src/entity/animation/ConsumingItemAnimation.php +++ b/src/entity/animation/ConsumingItemAnimation.php @@ -23,7 +23,7 @@ declare(strict_types=1); namespace pocketmine\entity\animation; -use pocketmine\entity\Human; +use pocketmine\entity\Living; use pocketmine\item\Item; use pocketmine\network\mcpe\convert\TypeConverter; use pocketmine\network\mcpe\protocol\ActorEventPacket; @@ -32,7 +32,7 @@ use pocketmine\network\mcpe\protocol\types\ActorEvent; final class ConsumingItemAnimation implements Animation{ public function __construct( - private Human $human, //TODO: maybe this can be expanded to more than just player entities? + private Living $entity, private Item $item ){} @@ -40,7 +40,7 @@ final class ConsumingItemAnimation implements Animation{ [$netId, $netData] = TypeConverter::getInstance()->getItemTranslator()->toNetworkId($this->item); return [ //TODO: need to check the data values - ActorEventPacket::create($this->human->getId(), ActorEvent::EATING_ITEM, ($netId << 16) | $netData) + ActorEventPacket::create($this->entity->getId(), ActorEvent::EATING_ITEM, ($netId << 16) | $netData) ]; } }