Interface SoundReceiver

All Known Implementing Classes:
PlayerMock

public interface SoundReceiver
This interface provides methods to assert sounds that were heard. This is implemented by PlayerMock, however the sheer amount of assertion methods did warrant a separate a file at some point.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addHeardSound(@NotNull AudioExperience audioExperience)
    Adds a heard sound.
    default void
    assertSoundHeard(@NotNull String sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull String sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull String sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull Sound sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull String message, @NotNull Sound sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull Sound sound)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    assertSoundHeard(@NotNull Sound sound, @NotNull Predicate<AudioExperience> predicate)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    Clears all heard sounds.
    This returns a List of every AudioExperience this receiver has received.
  • Method Details

    • getHeardSounds

      @NotNull @NotNull List<AudioExperience> getHeardSounds()
      This returns a List of every AudioExperience this receiver has received.
      Returns:
      A mutable List containing every heard sound.
    • addHeardSound

      default void addHeardSound(@NotNull @NotNull AudioExperience audioExperience)
      Adds a heard sound.
      Parameters:
      audioExperience - An AudioExperience representing the heard sound.
    • clearSounds

      default void clearSounds()
      Clears all heard sounds.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull Sound sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Assert that a sound type has been played for this sound receiver.

      The adventure method also checks the source of the sound, the volume and the pitch.

      Parameters:
      sound - The sound type to check.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Assert that a sound with a given source, volume and pitch have been played for this sound receiver.
      Parameters:
      sound - The sound to check.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Assert that a sound key has been played for this sound receiver.

      The adventure method also checks the source of the sound, the volume and the pitch.

      Parameters:
      sound - The sound key to check.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      sound - The sound name that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull Sound sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull String sound)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound name that should've been heard.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      @Deprecated(forRemoval=true) default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull String sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound name that should've been heard.
      predicate - A predicate to test the AudioExperience against.