diff --git a/api/src/main/java/net/kyori/adventure/audience/Audience.java b/api/src/main/java/net/kyori/adventure/audience/Audience.java index 2af2d7855..ed93f4c65 100644 --- a/api/src/main/java/net/kyori/adventure/audience/Audience.java +++ b/api/src/main/java/net/kyori/adventure/audience/Audience.java @@ -469,12 +469,19 @@ default void playSound(final @NotNull Sound sound, final double x, final double /** * Plays a sound from an emitter, usually an entity. * + *

+ * Sounds played from an emitter will follow the entity unless the sound is custom sound. + * In the case where a custom sound is provided, the sound will be played at the location of the emitter at the time of calling. + *

+ * + *

Note: Due to MC-138832, the volume and pitch may be ignored when using this method.

+ * * @param sound a sound * @param emitter an emitter * @see Sound * @since 4.8.0 */ - default void playSound(final @NonNull Sound sound, final Sound.@NonNull Emitter emitter) { + default void playSound(final @NotNull Sound sound, final Sound.@NotNull Emitter emitter) { } /** diff --git a/api/src/main/java/net/kyori/adventure/audience/ForwardingAudience.java b/api/src/main/java/net/kyori/adventure/audience/ForwardingAudience.java index 6da39568b..46e4b69be 100644 --- a/api/src/main/java/net/kyori/adventure/audience/ForwardingAudience.java +++ b/api/src/main/java/net/kyori/adventure/audience/ForwardingAudience.java @@ -144,7 +144,7 @@ default void playSound(final @NotNull Sound sound, final double x, final double @Override default void playSound(final @NotNull Sound sound, final Sound.@NotNull Emitter emitter) { - for(final Audience audience : this.audiences()) audience.playSound(sound, emitter); + for (final Audience audience : this.audiences()) audience.playSound(sound, emitter); } @Override @@ -266,7 +266,7 @@ default void playSound(final @NotNull Sound sound, final double x, final double } @Override - default void playSound(final @NonNull Sound sound, final Sound.@NonNull Emitter emitter) { + default void playSound(final @NotNull Sound sound, final Sound.@NotNull Emitter emitter) { this.audience().playSound(sound, emitter); } diff --git a/api/src/main/java/net/kyori/adventure/sound/Sound.java b/api/src/main/java/net/kyori/adventure/sound/Sound.java index 3f4a7c6e3..f41350ff1 100644 --- a/api/src/main/java/net/kyori/adventure/sound/Sound.java +++ b/api/src/main/java/net/kyori/adventure/sound/Sound.java @@ -250,6 +250,7 @@ interface Type extends Keyed { /** * An emitter of sounds. * + * @see net.kyori.adventure.audience.Audience#playSound(Sound, Emitter) * @since 4.8.0 */ interface Emitter {