Conversation
- Add `Configuration` class and `config.yml` for managing custom vault cooldown delays. - Introduce utility methods for storing and retrieving `UUID`-based data in persistent data containers. - Register new `NamespacedKey` constants for tracking vault cooldowns and unlocking players. - Refactor vault scanning and processing to leverage Paper schedulers for improved performance. - Implement core cooldown logic to track players and remove them from vanilla rewards upon expiry. - Handle `VaultChangeStateEvent` to accurately manage player cooldown states during vault interactions. - Update plugin lifecycle to load default configuration and manage tasks effectively. Rationale: This change provides server administrators with granular control over vault cooldowns, allowing custom delay durations for normal and ominous vaults. It ensures players cannot immediately re-claim rewards, thereby balancing gameplay and enhancing the plugin's utility.
- Make `Configuration.Section` a static nested class for better encapsulation. - Ensure vault delay configurations are always non-negative. - Improve deserialisation robustness for cooldown and rewarded maps. - Clear `blockListPool` at the start of `scanBlocksForVaults`. - Clear internal caches after `despawnAllVaults` to prevent memory leaks. - Correct `onVaultChangeState` visibility to `public` for proper event handling. Rationale: These adjustments enhance the plugin's resilience to invalid configurations and corrupted data, optimise resource management, and ensure correct event processing, addressing points raised during a pull request review.
- Removed redundant `else` from an `else if` statement. - Changed `else if (condition)` to `if (condition)` following an early `return`. - Clarifies distinct, sequential guard clauses for improved readability. Rationale: To enhance code clarity by explicitly showing two independent guard clauses. The `else` keyword was redundant, as the preceding `if` block always returned early, making the subsequent `if` evaluate unconditionally.
- Make `fileConfiguration` and `delay` fields in `Configuration` final. - Remove `ThreadLocal` object pools for `HashMap` and `ArrayList`. - Simplify block collection in `onPlayerMove` by using direct instantiation. - Add null check for `event.getPlayer()` in `onVaultStateChange`. - Clarify `config.yml` comments regarding vault reset delay behaviour. Rationale: Address PR review comments by simplifying object management for improved code clarity and maintainability, while also enhancing robustness with immutability and defensive null checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4.