Skip to content

Conversation

@TheBjoRedCraft
Copy link
Member

This pull request adds integration with the optional surf-settings-paper plugin, 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 new SettingsService for managing this functionality.

Settings integration and sound control:

  • Added a new SettingsService in SettingsService.kt to 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.
  • Updated SpecialItemListener to 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:

  • Modified PaperMain to check for the presence of the surf-settings-paper plugin 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:

  • Bumped the project version in gradle.properties to 1.21.10-2.0.4-SNAPSHOT.

@TheBjoRedCraft TheBjoRedCraft requested a review from a team November 2, 2025 00:58
@TheBjoRedCraft TheBjoRedCraft self-assigned this Nov 2, 2025
Copilot AI review requested due to automatic review settings November 2, 2025 00:58
Copy link
Contributor

Copilot AI left a 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 SettingsService to 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.

Copy link

Copilot AI commented Nov 2, 2025

@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>
@TheBjoRedCraft TheBjoRedCraft marked this pull request as draft November 2, 2025 01:45
auto-merge was automatically disabled November 2, 2025 01:45

Pull request was converted to draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants