fix: reduce BentoBox monster-class coupling from 24 to 20 (S1200)#2826
Merged
tastybento merged 1 commit intodevelopfrom Mar 4, 2026
Merged
fix: reduce BentoBox monster-class coupling from 24 to 20 (S1200)#2826tastybento merged 1 commit intodevelopfrom
tastybento merged 1 commit intodevelopfrom
Conversation
Extract two focused helper classes to satisfy SRP and bring BentoBox's efferent coupling within the Sonar-authorised limit of 20 packages: - BentoBoxListenerRegistrar: owns all event-listener registration and the IslandDeletionManager lifecycle, removing the listeners.teleports package and the PluginManager import from BentoBox. - BentoBoxHookRegistrar: owns all hook instantiation (early, world, and late phases) plus the hasClass() Multiverse detection, removing the hooks.placeholders package from BentoBox. - CommandsManager.registerDefaultCommands(): moves `new BentoBoxCommand()` out of BentoBox, removing the commands package import. No behavioural changes; full test suite passes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.



Summary
BentoBoxListenerRegistrar(listenerspackage) to own all Bukkit event-listener registration and theIslandDeletionManagerlifecycle.BentoBoxHookRegistrar(hookspackage) to own all hook instantiation (early / world / late phases) and Multiverse class-detection logic.new BentoBoxCommand()intoCommandsManager.registerDefaultCommands(), the natural home for "which commands does BentoBox register".These three changes remove four package-level dependencies from
BentoBox.java(org.bukkit.plugin,listeners.teleports,hooks.placeholders,commands), dropping the Sonar S1200 efferent-coupling count from 24 → 20.No behavioural changes; the new classes land in packages already imported by
BentoBox, so no new dependencies are introduced.Test plan
./gradlew compileJava— clean build, no errors./gradlew test— full test suite passes🤖 Generated with Claude Code