Implemented a silent property on entities and Entity->broadcastSound()

fixes #3516
This commit is contained in:
Dylan K. Taylor
2020-10-31 16:07:18 +00:00
parent 66edf5a165
commit 8be0c0da0d
8 changed files with 33 additions and 11 deletions

View File

@ -137,7 +137,7 @@ class Arrow extends Projectile{
protected function onHit(ProjectileHitEvent $event) : void{
$this->setCritical(false);
$this->getWorld()->addSound($this->location, new ArrowHitSound());
$this->broadcastSound(new ArrowHitSound());
}
protected function onHitBlock(Block $blockHit, RayTraceResult $hitResult) : void{

View File

@ -40,7 +40,7 @@ class ExperienceBottle extends Throwable{
public function onHit(ProjectileHitEvent $event) : void{
$this->getWorld()->addParticle($this->location, new PotionSplashParticle(PotionSplashParticle::DEFAULT_COLOR()));
$this->getWorld()->addSound($this->location, new PotionSplashSound());
$this->broadcastSound(new PotionSplashSound());
$this->getWorld()->dropExperience($this->location, mt_rand(3, 11));
}

View File

@ -92,7 +92,7 @@ class SplashPotion extends Throwable{
}
$this->getWorld()->addParticle($this->location, $particle);
$this->getWorld()->addSound($this->location, new PotionSplashSound());
$this->broadcastSound(new PotionSplashSound());
if($hasEffects){
if(!$this->willLinger()){