Interface SoundSupport

    • Method Detail

      • isSound

        boolean isSound​(String name)
        Check if the given sound is valid for the current server version.
        Parameters:
        name - sound name.
        Returns:
        true if given name is an existing sound.
      • getSound

        @Nullable
        org.bukkit.Sound getSound​(String name)
        Get sound by name.
        Parameters:
        name - sound name.
        Returns:
        Sound with given name. Null if does not exist.
      • getSoundOr

        org.bukkit.Sound getSoundOr​(String name,
                                    org.bukkit.Sound alternative)
        Get sound by name if valid or fallback sound.
        Parameters:
        name - sound name.
        alternative - alternative if not found.
        Returns:
        sound with given name or alternative if not found.
      • getForCurrentVersion

        @Nullable
        org.bukkit.Sound getForCurrentVersion​(String v1_8,
                                              String v1_12,
                                              String v1_13)
        Get sound for current server version.
        Parameters:
        v1_8 - sound name. Will return this if server version is 1.8.
        v1_12 - sound name. Will return this is server version is in range [1.9,1.12]
        v1_13 - sound name. Will return this if server version is in range [1.13,)
        Returns:
        right sound for current version.