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 voidaddHeardSound(@NotNull AudioExperience audioExperience) Adds a heard sound.default voidassertSoundHeard(@NotNull String sound) Assert that a sound key has been played for this sound receiver.default voidassertSoundHeard(@NotNull String message, @NotNull String sound) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String message, @NotNull String sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String message, @NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String message, @NotNull org.bukkit.Sound sound) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull String message, @NotNull org.bukkit.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidassertSoundHeard(@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 voidassertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidassertSoundHeard(@NotNull org.bukkit.Sound sound) Assert that a sound type has been played for this sound receiver.default voidassertSoundHeard(@NotNull org.bukkit.Sound sound, @NotNull Predicate<AudioExperience> predicate) Asserts that a sound was heard.default voidClears all heard sounds.@NotNull List<AudioExperience> This returns aListof everyAudioExperiencethis receiver has received.
-
Method Details
-
getHeardSounds
This returns aListof everyAudioExperiencethis receiver has received.- Returns:
- A mutable
Listcontaining every heard sound.
-
addHeardSound
Adds a heard sound.- Parameters:
audioExperience- AnAudioExperiencerepresenting the heard sound.
-
clearSounds
default void clearSounds()Clears all heard sounds. -
assertSoundHeard
default void assertSoundHeard(@NotNull @NotNull org.bukkit.Sound sound) Assert that a sound type has been played for this sound receiver.The
adventure methodalso 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 methodalso checks the source of the sound, the volume and the pitch.- Parameters:
sound- The sound key to check.
-
assertSoundHeard
default void assertSoundHeard(@NotNull @NotNull org.bukkit.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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
assertSoundHeard
default void assertSoundHeard(@NotNull @NotNull String message, @NotNull @NotNull org.bukkit.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
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 org.bukkit.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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-