Class Sounds
java.lang.Object
com.github.darksoulq.abyssallib.server.resource.asset.Sounds
- All Implemented Interfaces:
Asset
Acts as the centralized registry for custom sound events within a specific namespace.
This class implements the Asset interface and is responsible for managing
multiple SoundEvent instances, eventually compiling them into a single
sounds.json file during resource pack generation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCompiles all registered sound events into the standardsounds.jsonstructure and exports the physical .ogg files into the final resource pack byte map.@NotNull SoundEventCreates or retrieves aSoundEventlinked to the specified event name.
-
Constructor Details
-
Sounds
public Sounds(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String namespace) Constructs a new Sound registry for a designated namespace.- Parameters:
plugin- The plugin providing the foundational resource context.namespace- The namespace prefix used for all JSON definitions and file structures.
-
-
Method Details
-
event
Creates or retrieves aSoundEventlinked to the specified event name.Note: The event name represents the trigger identifier (e.g., "entity.custom_zombie.ambient"), not the actual name of the physical .ogg file.
- Parameters:
eventName- The registry name for this sound event.- Returns:
- The resulting
SoundEventinstance for method chaining and variant registration.
-
emit
Compiles all registered sound events into the standardsounds.jsonstructure and exports the physical .ogg files into the final resource pack byte map.
-