Package be.seeseemelk.mockbukkit.sound
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 TypeMethodDescriptiondefault void
addHeardSound
(@NotNull AudioExperience audioExperience) Adds a heard sound.default void
assertSoundHeard
(@NotNull String sound) Assert that a sound key has been played for this sound receiver.default void
assertSoundHeard
(@NotNull String message, @NotNull String sound) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String message, @NotNull String sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String message, @NotNull Sound sound) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull String message, @NotNull Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.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.default void
assertSoundHeard
(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default void
assertSoundHeard
(@NotNull Sound sound) Assert that a sound type has been played for this sound receiver.default void
assertSoundHeard
(@NotNull Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default void
Clears all heard sounds.@NotNull List<AudioExperience>
This returns aList
of everyAudioExperience
this receiver has received.
-
Method Details
-
getHeardSounds
This returns aList
of everyAudioExperience
this receiver has received.- Returns:
- A mutable
List
containing every heard sound.
-
addHeardSound
Adds a heard sound.- Parameters:
audioExperience
- AnAudioExperience
representing the heard sound.
-
clearSounds
default void clearSounds()Clears all heard sounds. -
assertSoundHeard
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
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 theAudioExperience
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 theAudioExperience
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 theAudioExperience
against.
-
assertSoundHeard
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
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 theAudioExperience
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 theAudioExperience
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 theAudioExperience
against.
-