public interface SoundRegistry extends ResourcePackPart, net.kyori.adventure.key.Namespaced, net.kyori.examination.Examinable
SoundEvent registry.| Modifier and Type | Interface and Description |
|---|---|
static interface |
SoundRegistry.Builder
A sound registry builder.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
addTo(@NotNull ResourceContainer resourceContainer)
Adds this sound registry to the given resource container.
|
static @NotNull SoundRegistry.Builder |
builder()
Deprecated.
Use
soundRegistry() instead |
@NotNull java.lang.String |
namespace()
Gets the sound registry namespace.
|
static @NotNull SoundRegistry |
of(@NotNull java.lang.String namespace,
@NotNull java.util.Set<SoundEvent> sounds)
Deprecated.
Use
soundRegistry(String, Set) instead |
@Nullable SoundEvent |
sound(@NotNull net.kyori.adventure.key.Key key)
Returns the sound event with the given
key, or null if not found.
|
static @NotNull SoundRegistry.Builder |
soundRegistry()
Creates a new registry builder.
|
static @NotNull SoundRegistry |
soundRegistry(@NotNull java.lang.String namespace,
@NotNull java.util.Collection<SoundEvent> sounds)
Creates a new registry from the given
sounds.
|
static @NotNull SoundRegistry |
soundRegistry(@NotNull java.lang.String namespace,
@NotNull java.util.Set<SoundEvent> sounds)
Creates a new registry from the given
sounds.
|
@Unmodifiable @NotNull java.util.Collection<SoundEvent> |
sounds()
Returns an unmodifiable collection of
the registered sound events.
|
compound, compound@NotNull static @NotNull SoundRegistry soundRegistry(@NotNull @NotNull java.lang.String namespace, @NotNull @NotNull java.util.Set<SoundEvent> sounds)
namespace - The sound registry namespacesounds - The registered sounds@NotNull static @NotNull SoundRegistry soundRegistry(@NotNull @NotNull java.lang.String namespace, @NotNull @NotNull java.util.Collection<SoundEvent> sounds)
namespace - The sound registry namespacesounds - The registered sounds@NotNull static @NotNull SoundRegistry.Builder soundRegistry()
@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull SoundRegistry of(@NotNull @NotNull java.lang.String namespace, @NotNull @NotNull java.util.Set<SoundEvent> sounds)
soundRegistry(String, Set) insteadnamespace - The sound registry namespacesounds - The registered sounds@Deprecated @ApiStatus.ScheduledForRemoval(inVersion="2.0.0") @NotNull static @NotNull SoundRegistry.Builder builder()
soundRegistry() instead@Pattern(value="[a-z0-9_\\-.]+") @NotNull @NotNull java.lang.String namespace()
The returned namespace is a valid argument
for the first parameter of Key.key(String, String).
namespace in interface net.kyori.adventure.key.Namespaced@NotNull @Unmodifiable @NotNull java.util.Collection<SoundEvent> sounds()
Note that all the sound events in this
collection will have a namespace equal to
the registry namespace.
@Nullable @Nullable SoundEvent sound(@NotNull @NotNull net.kyori.adventure.key.Key key)
key - The sound event keydefault void addTo(@NotNull
@NotNull ResourceContainer resourceContainer)
addTo in interface ResourcePackPartresourceContainer - The resource container