Implement Sound.Source.Provider

This commit is contained in:
Kieran Wallbanks 2021-06-10 13:53:21 +01:00
parent 80a5356711
commit e7e0d4cb0d

View File

@ -1,14 +1,13 @@
package net.minestom.server.sound; package net.minestom.server.sound;
import net.kyori.adventure.sound.Sound;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import static net.kyori.adventure.sound.Sound.*;
/** /**
* @deprecated Use {@link Source} * @deprecated Use {@link Sound.Source}
*/ */
@Deprecated @Deprecated
public enum SoundCategory { public enum SoundCategory implements Sound.Source.Provider {
MASTER, MASTER,
MUSIC, MUSIC,
RECORDS, RECORDS,
@ -24,8 +23,15 @@ public enum SoundCategory {
* Gets the Adventure source representing this sound category. * Gets the Adventure source representing this sound category.
* *
* @return the source * @return the source
* @deprecated Use {@link #soundSource()}
*/ */
public @NotNull Source asSource() { @Deprecated
return Source.values()[this.ordinal()]; public @NotNull Sound.Source asSource() {
return this.soundSource();
}
@Override
public @NotNull Sound.Source soundSource() {
return Sound.Source.values()[this.ordinal()];
} }
} }