From ec49a0bba79e1aaa63f11e04969902259cff72ed Mon Sep 17 00:00:00 2001 From: ipad54 <63200545+ipad54@users.noreply.github.com> Date: Sun, 1 Sep 2024 14:13:02 +0300 Subject: [PATCH] Implemented sound when drinking a potion --- 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 41b0f634a88..192a257841f 100644 --- a/src/item/Potion.php +++ b/src/item/Potion.php @@ -26,6 +26,7 @@ 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 @@ public function getMaxStackSize() : int{ } 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 00000000000..bb2a0be2ad1 --- /dev/null +++ b/src/world/sound/BottleEmptySound.php @@ -0,0 +1,35 @@ +