mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Implemented a silent property on entities and Entity->broadcastSound()
fixes #3516
This commit is contained in:
@ -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{
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -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()){
|
||||
|
Reference in New Issue
Block a user