diff --git a/src/pocketmine/level/sound/ItemBreakSound.php b/src/pocketmine/level/sound/ItemBreakSound.php new file mode 100644 index 000000000..35cf8e258 --- /dev/null +++ b/src/pocketmine/level/sound/ItemBreakSound.php @@ -0,0 +1,34 @@ +xpLevel = $xpLevel; + } + + /** + * @return int + */ + public function getXpLevel() : int{ + return $this->xpLevel; + } + + public function encode(Vector3 $pos){ + //No idea why such odd numbers, but this works... + //TODO: check arbitrary volume + return LevelSoundEventPacket::create(LevelSoundEventPacket::SOUND_LEVELUP, $pos, 0x10000000 * (min(30, $this->xpLevel) / 5)); + } +}