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 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

      default void assertSoundHeard(@NotNull @NotNull Sound sound)
      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

      default void assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound)
      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

      default void assertSoundHeard(@NotNull @NotNull String sound)
      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

      default void assertSoundHeard(@NotNull @NotNull Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Asserts that a sound was heard.
      Parameters:
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      default void assertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      Asserts that a sound was heard.
      Parameters:
      sound - The sound that should've been heard.
      predicate - A predicate to test the AudioExperience against.
    • assertSoundHeard

      default void assertSoundHeard(@NotNull @NotNull String sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      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

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull Sound sound)
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
    • assertSoundHeard

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound)
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound that should've been heard.
    • assertSoundHeard

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull String sound)
      Asserts that a sound was heard.
      Parameters:
      message - The message to fail with.
      sound - The sound name that should've been heard.
    • assertSoundHeard

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      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

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      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

      default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull String sound, @NotNull @NotNull Predicate<AudioExperience> predicate)
      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.