Clean up LevelSoundEvent handling

This commit is contained in:
Dylan K. Taylor
2019-03-26 19:53:40 +00:00
parent e1504c668e
commit 0aebb3f4fb
38 changed files with 693 additions and 85 deletions

View File

@ -25,7 +25,7 @@ namespace pocketmine\entity\projectile;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\level\particle\PotionSplashParticle;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\level\sound\PotionSplashSound;
use function mt_rand;
class ExperienceBottle extends Throwable{
@ -39,7 +39,7 @@ class ExperienceBottle extends Throwable{
public function onHit(ProjectileHitEvent $event) : void{
$this->level->addParticle($this, new PotionSplashParticle(PotionSplashParticle::DEFAULT_COLOR()));
$this->level->broadcastLevelSoundEvent($this, LevelSoundEventPacket::SOUND_GLASS);
$this->level->addSound($this, new PotionSplashSound());
$this->level->dropExperience($this, mt_rand(3, 11));
}