Skip to content

Cleanup ItemMelee - #637

Merged
Desoroxxx merged 2 commits into
nextfrom
strubium/item-melee
Jul 3, 2026
Merged

Desoroxxx merged 2 commits into
nextfrom
strubium/item-melee

Conversation

@strubium

Copy link
Copy Markdown
Member

📝 Description

Cleans up ItemMelee

🎯 Goals

Remove random stuff from ItemMelee for the sake of making the class easier to understand

❌ Non Goals

Chang how ItemMelee works

🚦 Testing

Kill like 40 sheep with the tac tomahawk

⏮️ Backwards Compatibility

yes

📚 Related Issues & Documents

n/a

🖼️ Screenshots/Recordings

n/a

📖 Added to documentation?

  • 📜 README.md
  • 📑 Documentation
  • 📓 Javadoc
  • 🍕 Comments
  • 🙅 No documentation needed

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 55dbaac0-5c4d-4e06-950f-b68fb92b7861

📥 Commits

Reviewing files that changed from the base of the PR and between 7a62a7e and 8d26b3f.

📒 Files selected for processing (2)
  • src/main/java/com/paneedah/weaponlib/melee/ItemMelee.java
  • src/main/java/com/paneedah/weaponlib/melee/MeleeAttackAspect.java

Walkthrough

ItemMelee.Builder is updated to extend AbstractItemBuilder<Builder>, removing redundant name/creativeTab fields and their setter methods. Sound fields are consolidated to attackSound and heavyAttackSound with Lombok-generated getters, replacing several explicit accessor methods. @Nonnull annotations are added to multiple overridden item methods, attachment filtering is corrected to use keySet(), a stub method is removed, and misspelled sound getter calls in MeleeAttackAspect are fixed.

Changes

ItemMelee Builder/Sound Refactor

Layer / File(s) Summary
Builder extends AbstractItemBuilder, sound fields consolidated
src/main/java/com/paneedah/weaponlib/melee/ItemMelee.java
Builder now extends AbstractItemBuilder<Builder>, removing name/creativeTab fields, withName, and withCreativeTab methods; build() uses superclass tab; sound fields replaced by @Getter private SoundEvent attackSound/heavyAttackSound; misspelled getHeavyAtackSound/getLightAtackSound methods removed.
ItemMelee method annotations and API cleanup
src/main/java/com/paneedah/weaponlib/melee/ItemMelee.java
getName() delegates to builder.getName(); @Nonnull added to onEntitySwing, getMaxItemUseDuration, addInformation, hitEntity, and shouldCauseReequipAnimation; getCompatibleAttachments filters keySet() instead of entrySet(); stubbed getEquivalentHandler removed.
Fix misspelled sound getters in MeleeAttackAspect
src/main/java/com/paneedah/weaponlib/melee/MeleeAttackAspect.java
attackClient corrected to call getHeavyAttackSound() and getAttackSound() instead of the prior misspelled method names.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • Desoroxxx
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: a cleanup of ItemMelee.
Description check ✅ Passed The description is clearly about cleaning up ItemMelee and stays on-topic.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch strubium/item-melee

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot requested a review from Desoroxxx June 30, 2026 15:19
@Desoroxxx
Desoroxxx merged commit 217b37f into next Jul 3, 2026
7 checks passed
@Desoroxxx
Desoroxxx deleted the strubium/item-melee branch July 3, 2026 20:46
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