Package org.mockbukkit.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) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@NotNull String message, @NotNull String sound) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@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 voidassertSoundHeard(@NotNull String sound, @NotNull Predicate<AudioExperience> predicate) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@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 voidassertSoundHeard(@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 voidassertSoundHeard(@NotNull String message, @NotNull Sound sound) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@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 voidassertSoundHeard(@NotNull net.kyori.adventure.sound.Sound sound) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@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 voidassertSoundHeard(@NotNull Sound sound) Deprecated, for removal: This API element is subject to removal in a future version.default voidassertSoundHeard(@NotNull Sound sound, @NotNull Predicate<AudioExperience> predicate) Deprecated, for removal: This API element is subject to removal in a future version.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
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 methodalso 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, 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 methodalso 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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-
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 theAudioExperienceagainst.
-