Skip to content

Commit

Permalink
Self emitter changes, javadoc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kezz committed Jun 7, 2021
1 parent e279a0f commit 540e39b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/net/kyori/adventure/audience/Audience.java
Expand Up @@ -476,12 +476,12 @@ default void playSound(final @NotNull Sound sound, final double x, final double
* In this case the sound will be played at the location of the emitter and will not follow them.
* </p>
*
* <p>To play a sound that follows the recipient, use {@link Sound.Emitter#self()}.</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
* @see Sound.Emitter
* @since 4.8.0
*/
default void playSound(final @NotNull Sound sound, final Sound.@NotNull Emitter emitter) {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/net/kyori/adventure/sound/Sound.java
Expand Up @@ -263,7 +263,7 @@ interface Emitter {
* @since 4.8.0
*/
static @NotNull Emitter self() {
return SoundImpl.SELF;
return SoundImpl.EMITTER_SELF;
}
}
}
7 changes: 6 additions & 1 deletion api/src/main/java/net/kyori/adventure/sound/SoundImpl.java
Expand Up @@ -31,7 +31,12 @@
import org.jetbrains.annotations.Nullable;

abstract class SoundImpl implements Sound {
static final Emitter SELF = new Emitter() {};
static final Emitter EMITTER_SELF = new Emitter() {
@Override
public String toString() {
return "SelfSoundEmitter";
}
};

private final Source source;
private final float volume;
Expand Down

0 comments on commit 540e39b

Please sign in to comment.