mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
Remove remaining direct protocol usages for particles
This commit is contained in:
@ -24,9 +24,8 @@ declare(strict_types=1);
|
||||
namespace pocketmine\entity\projectile;
|
||||
|
||||
use pocketmine\event\entity\ProjectileHitEvent;
|
||||
use pocketmine\network\mcpe\protocol\LevelEventPacket;
|
||||
use pocketmine\level\particle\PotionSplashParticle;
|
||||
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
|
||||
use pocketmine\utils\Color;
|
||||
use function mt_rand;
|
||||
|
||||
class ExperienceBottle extends Throwable{
|
||||
@ -39,7 +38,7 @@ class ExperienceBottle extends Throwable{
|
||||
}
|
||||
|
||||
public function onHit(ProjectileHitEvent $event) : void{
|
||||
$this->level->broadcastLevelEvent($this, LevelEventPacket::EVENT_PARTICLE_SPLASH, (new Color(0x38, 0x5d, 0xc6))->toARGB());
|
||||
$this->level->addParticle($this, new PotionSplashParticle(PotionSplashParticle::DEFAULT_COLOR()));
|
||||
$this->level->broadcastLevelSoundEvent($this, LevelSoundEventPacket::SOUND_GLASS);
|
||||
|
||||
$this->level->dropExperience($this, mt_rand(3, 11));
|
||||
|
Reference in New Issue
Block a user