diff --git a/CONFIG.md b/CONFIG.md index 6922e78..cc080d1 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -112,6 +112,26 @@ publickits: ``` +### **Sounds** + +This section allows you to enable, disable, and customize the sounds played by the plugin. + +```yaml +sounds: + enabled: true # Set to false to disable all plugin sounds. + # Sound played on successful actions (e.g. saving a kit) + success: ENTITY_PLAYER_LEVELUP + # Sound played on failed actions (e.g. attempting to use a disabled command) + failure: ENTITY_ITEM_BREAK + # Sound played when a button is clicked in a GUI + click: UI_BUTTON_CLICK + # Sound played when a GUI is opened + open_gui: UI_BUTTON_CLICK + # Sound played when a GUI is closed + close_gui: UI_BUTTON_CLICK +``` + + ### **Anti-Exploit** This section allows you to enable or disable anti-exploit features, commonly applicable to this plugin. diff --git a/src/main/java/dev/noah/perplayerkit/util/SoundManager.java b/src/main/java/dev/noah/perplayerkit/util/SoundManager.java index bcb5961..f98b65c 100644 --- a/src/main/java/dev/noah/perplayerkit/util/SoundManager.java +++ b/src/main/java/dev/noah/perplayerkit/util/SoundManager.java @@ -58,6 +58,10 @@ public static void playCloseGui(Player player) { } private static void play(Player player, Sound sound) { + // exit if sounds are disabled + if (!PerPlayerKit.getPlugin().getConfig().getBoolean("sounds.enabled", true)) { + return; + } player.playSound(player.getLocation(), sound, 1.0f, 1.0f); } } \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 43eae5d..46bfd19 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -151,13 +151,14 @@ feature: # Sound settings for plugin feedback sounds: - # Sound to play on successful actions (e.g. kit load, save, delete, repair) + enabled: true + # Sound played on successful actions (e.g. saving a kit) success: ENTITY_PLAYER_LEVELUP - # Sound to play on failed actions or errors + # Sound played on failed actions (e.g. attempting to use a disabled command) failure: ENTITY_ITEM_BREAK - # Sound for generic UI clicks + # Sound played when a button is clicked in a GUI click: UI_BUTTON_CLICK - # Sound when opening a GUI/menu + # Sound played when a GUI is opened open_gui: UI_BUTTON_CLICK - # Sound when closing a GUI/menu + # Sound played when a GUI is closed close_gui: UI_BUTTON_CLICK