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

@ -33,8 +33,8 @@ use pocketmine\event\entity\ProjectileHitEntityEvent;
use pocketmine\event\entity\ProjectileHitEvent;
use pocketmine\item\Potion;
use pocketmine\level\particle\PotionSplashParticle;
use pocketmine\level\sound\PotionSplashSound;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\utils\Color;
use function round;
use function sqrt;
@ -82,7 +82,7 @@ class SplashPotion extends Throwable{
}
$this->level->addParticle($this, $particle);
$this->level->broadcastLevelSoundEvent($this, LevelSoundEventPacket::SOUND_GLASS);
$this->level->addSound($this, new PotionSplashSound());
if($hasEffects){
if(!$this->willLinger()){