Skip to content

Commit

Permalink
Fix formatting, clarify javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
kezz committed Jun 4, 2021
1 parent 49ab99e commit b3f0482
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion api/src/main/java/net/kyori/adventure/audience/Audience.java
Expand Up @@ -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.
*
* <p>
* 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.
* </p>
*
* <p><b>Note</b>: Due to <a href="https://bugs.mojang.com/browse/MC-138832">MC-138832</a>, the volume and pitch may be ignored when using this method.</p>
*
* @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) {
}

/**
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/net/kyori/adventure/sound/Sound.java
Expand Up @@ -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 {
Expand Down

0 comments on commit b3f0482

Please sign in to comment.