Added sound when picking sweet berries (#6287)

This commit is contained in:
ipad54
2024-03-19 13:18:30 +03:00
committed by GitHub
parent 0e5395c59b
commit b680a1693c
2 changed files with 37 additions and 0 deletions

View File

@ -36,6 +36,7 @@ use pocketmine\item\VanillaItems;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
use pocketmine\world\sound\SweetBerriesPickSound;
use function mt_rand;
class SweetBerryBush extends Flowable{
@ -81,6 +82,7 @@ class SweetBerryBush extends Flowable{
}elseif(($dropAmount = $this->getBerryDropAmount()) > 0){
$world->setBlock($this->position, $this->setAge(self::STAGE_BUSH_NO_BERRIES));
$world->dropItem($this->position, $this->asItem()->setCount($dropAmount));
$world->addSound($this->position, new SweetBerriesPickSound());
}
return true;