Play burp sound when consuming a FoodSource (#5158)

This commit is contained in:
IvanCraft623
2022-09-27 11:21:55 -05:00
committed by GitHub
parent e2f1b10165
commit 5e5661de75
2 changed files with 39 additions and 0 deletions

View File

@ -56,6 +56,7 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\player\Player;
use pocketmine\timings\Timings;
use pocketmine\utils\Binary;
use pocketmine\world\sound\BurpSound;
use pocketmine\world\sound\EntityLandSound;
use pocketmine\world\sound\EntityLongFallSound;
use pocketmine\world\sound\EntityShortFallSound;
@ -320,6 +321,9 @@ abstract class Living extends Entity{
foreach($consumable->getAdditionalEffects() as $effect){
$this->effectManager->add($effect);
}
if($consumable instanceof FoodSource){
$this->broadcastSound(new BurpSound());
}
$consumable->onConsume($this);
}