Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/dev/noah/perplayerkit/util/SoundManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
11 changes: 6 additions & 5 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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