From 05a9e9c76ebe64251245f77eb53bc90e409651b6 Mon Sep 17 00:00:00 2001 From: ipad54 <63200545+ipad54@users.noreply.github.com> Date: Sun, 10 Nov 2024 18:07:18 +0300 Subject: [PATCH] Implemented sound when drinking a potion (#6444) --- src/item/Potion.php | 3 ++- src/world/sound/BottleEmptySound.php | 35 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/world/sound/BottleEmptySound.php diff --git a/src/item/Potion.php b/src/item/Potion.php index 41b0f634a..192a25784 100644 --- a/src/item/Potion.php +++ b/src/item/Potion.php @@ -26,6 +26,7 @@ namespace pocketmine\item; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\Living; use pocketmine\player\Player; +use pocketmine\world\sound\BottleEmptySound; class Potion extends Item implements ConsumableItem{ @@ -50,7 +51,7 @@ class Potion extends Item implements ConsumableItem{ } public function onConsume(Living $consumer) : void{ - + $consumer->broadcastSound(new BottleEmptySound()); } public function getAdditionalEffects() : array{ diff --git a/src/world/sound/BottleEmptySound.php b/src/world/sound/BottleEmptySound.php new file mode 100644 index 000000000..bb2a0be2a --- /dev/null +++ b/src/world/sound/BottleEmptySound.php @@ -0,0 +1,35 @@ +