-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add global rejoin cooldown option #17
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
feat: add global rejoin cooldown option #17
Conversation
Bumped the PlaceholderAPI dependency version from 2.11.3 to 2.11.6 in pom.xml to use the latest features and bug fixes.
Updated all method parameters in ClanManager.java to use the 'final' modifier for improved code safety and clarity. This change helps prevent accidental reassignment of parameters within methods.
Updated two instances of 'out.length() == 0' to use 'out.isEmpty()' for improved readability and consistency in ClanManager.java.
Added @NotNull annotation to ClanPlayer#getResignTimes to clarify non-null contract. Refactored ClanManager to remove redundant null check and improve variable naming for resign times map.
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
Adds support for a global rejoin cooldown feature that prevents players from creating new clans for a configured period after leaving any clan, as opposed to the existing per-clan rejoin cooldown.
Key changes:
- Introduces global rejoin cooldown configuration option alongside existing per-clan rejoin cooldown
- Implements cooldown validation for clan creation to prevent abuse through clan hopping
- Updates PlaceholderAPI dependency to newer version
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wiki/how-to-setup/configuration.md | Documents the new rejoin-cooldown-global configuration option |
| src/main/resources/config.yml | Adds the global rejoin cooldown setting with default value false |
| src/main/java/net/sacredlabyrinth/phaed/simpleclans/managers/SettingsManager.java | Defines the configuration field for global rejoin cooldown |
| src/main/java/net/sacredlabyrinth/phaed/simpleclans/managers/ClanManager.java | Implements global cooldown logic and refactors existing rejoin methods |
| src/main/java/net/sacredlabyrinth/phaed/simpleclans/commands/general/GeneralCommands.java | Adds cooldown validation to clan creation command |
| src/main/java/net/sacredlabyrinth/phaed/simpleclans/ClanPlayer.java | Adds @NotNull annotation to getResignTimes method |
| src/main/resources/messages*.properties | Adds localized message for global cooldown violation |
| pom.xml | Updates PlaceholderAPI dependency from 2.11.3 to 2.11.6 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Imported GLOBAL_REJOIN_COOLDOWN from SettingsManager.ConfigField in ClanManager. This prepares the manager for usage of the new configuration option.
VentureChatListener now extends SCListener and uses the plugin instance directly to access managers. This simplifies the constructor and removes redundant fields, improving code maintainability.
Changed the type of the 'cooldown' variable from long to int to match the return type of settings.getInt(REJOIN_COOLDOWN).
Added 'final' keyword to method parameters and local variables in ClanCommands.java and GeneralCommands.java for improved code safety and clarity. Also replaced wildcard and grouped imports with explicit imports in GeneralCommands.java to enhance readability and maintainability.
No description provided.