-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/add surf settings #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: version/1.21.10
Are you sure you want to change the base?
Conversation
…ggle functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds optional integration with a settings API to allow players to configure whether they receive special item sound notifications. The integration is designed as a soft dependency, maintaining backward compatibility.
- Introduces a new
SettingsServiceto manage player settings for special item sounds - Conditionally checks for the settings API and applies user preferences when available, falling back to default behavior when the API is not present
- Adds the surf-settings API as a soft dependency in the build configuration
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| SettingsService.kt | New service to register and query player sound preferences via the settings API |
| SpecialItemListener.kt | Modified to check player sound preferences before playing special item notification sounds |
| PaperMain.kt | Added settings service registration during plugin startup and helper method to check API availability |
| build.gradle.kts | Added surf-settings API as a compile-only dependency with soft plugin registration |
| gradle.properties | Bumped version to 1.21.10-2.0.4-SNAPSHOT |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/kotlin/dev/slne/surf/essentials/listener/SpecialItemListener.kt
Show resolved
Hide resolved
src/main/kotlin/dev/slne/surf/essentials/listener/SpecialItemListener.kt
Show resolved
Hide resolved
src/main/kotlin/dev/slne/surf/essentials/service/SettingsService.kt
Outdated
Show resolved
Hide resolved
|
@TheBjoRedCraft I've opened a new pull request, #14, to work on those changes. Once the pull request is ready, I'll request review from you. |
…ce.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Pull request was converted to draft
This pull request adds integration with the optional
surf-settings-paperplugin, enabling per-player control over special item sound effects. The changes ensure that if the settings plugin is present, players can toggle these sounds via a new setting; otherwise, the default behavior is preserved. The update also introduces a newSettingsServicefor managing this functionality.Settings integration and sound control:
SettingsServiceinSettingsService.ktto register a "Special Item Geräusche" setting and to check if a player has sounds enabled. This allows players to enable or disable special item sounds via the settings API.SpecialItemListenerto use the new setting: when a player receives a special item, the code now checks if the settings API is available and, if so, whether the player has enabled sounds before playing the sound effect. If the settings API is not present, the sound is always played as before. [1] [2]Plugin lifecycle and dependency handling:
PaperMainto check for the presence of thesurf-settings-paperplugin and to register the settings service only if it is available. The plugin's enable method was updated to be asynchronous (onEnableAsync). [1] [2]Version update:
gradle.propertiesto1.21.10-2.0.4-SNAPSHOT.