refactor: split the 3,300-line menu and command files and fix Auto Weapon #14
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
6b6t/AnarchyClient!14
Loading…
Reference in a new issue
No description provided.
Delete branch "t3/client-health-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A code review of the client found a few things that made it harder to work on safely.
ModulePanel.javawas 3,320 lines with 45 nested types.AnarchyClientCommands.javawas 1,712 lines with one 230-line method that built every command. Some catch blocks swallowed errors silently, about 100 class names were written out in full inline, and most modules had no tests, partly because Minecraft 26.3 tests couldn't create item stacks.Cross-plugin feature: this PR bundles several cleanups on purpose. The requester asked for one PR covering all review findings instead of one PR each. Each finding is its own commit, so review commit by commit.
Changes
refactor(ui)): every menu component has its own file.ModulePanelkeeps only state, navigation and top-level layout (622 lines). Former inner classes now get the panel through their constructor. Method bodies are otherwise unchanged; a token-level diff against the original nested classes shows only those mechanical changes.refactor(command)): each topic (modules, player, chat, server, profiles, waypoints, items, world) registers its own subtree. Shared helpers live inCommandSupport. A one-off comparison of the old and new dispatchers produced the same 78 usage paths.test):MinecraftBootstrapExtensionnow finishes Fabric's delayed registry freeze, loads vanilla tags and binds item components, so tests can create realItemStacks and check tags.fix(module)): Auto Weapon and Attribute Swap switched to any non-empty hotbar slot, such as blocks, when the hotbar had no weapon. They now only consider items with theWEAPONcomponent. Found by the new tests.fix): malformed legacy waypoints log a warning instead of disappearing silently. Two render-loop catches warn once per session, and failedclose()calls log at debug level.refactor): 100 inline fully qualified names became imports. The 17 left are real name clashes.ModulePanelsmoke test builds the full menu and visits every tab and drawer.Verification
./gradlew clean buildpasses, and all 438 tests pass.ModulePanelsmoke test fails if a component reads the panel before its constructor stores it, which I checked by breaking it on purpose.AI-assisted: written by Claude Code at the requester's direction, following a code review in the same session. There is no linked issue.
AGENTS.mdasks for a design issue before architecture changes; the requester explicitly chose to refactor now and review in this PR.Created with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share