pocketmine\network\protocol\LevelSoundEventPacket::getSound PHP Метод

getSound() публичный статический Метод

public static getSound ( $name )
    public static function getSound($name)
    {
        if (is_numeric($name)) {
            return $name;
        }
        if (!empty($name) && @self::getSounds()->{$name} !== null) {
            print self::getSounds()->{$name};
            print PHP_EOL;
            return self::getSounds()->{$name};
        }
        return false;
    }

Usage Example

Пример #1
0
 public function __construct(Vector3 $pos, $id, $pitch = 0)
 {
     if (LevelSoundEventPacket::getSound($id) === false) {
         print "fail";
         return;
     }
     parent::__construct($pos->x, $pos->y, $pos->z);
     $this->id = $id;
     $this->pitch = (double) $pitch * 1000;
     $this->volume = (int) 100;
     $this->unknownBool = (bool) true;
     $this->unknownBool2 = (bool) true;
 }
All Usage Examples Of pocketmine\network\protocol\LevelSoundEventPacket::getSound