returned magizen and grenade crafting functionality to the ammo press#627
returned magizen and grenade crafting functionality to the ammo press#627voroxity wants to merge 4 commits intoCubed-Development:nextfrom
Conversation
…nt#624) changed hard-coded values to IDs
…page 2
changed
if (getCraftingMode() == CraftingGroup.BULLET.getID()) {
to
if (getCraftingMode() == CraftingGroup.BULLET.getID() || getCraftingMode() == 1) {
so that the initial crafting mode value that is defined in GUIContainerStation.java is valid for this argument
WalkthroughUpdated GUIContainerAmmoPress.fillFilteredList() to use CraftingGroup ID comparisons (BULLET, MAGAZINE, GRENADE) instead of numeric literals when filtering by mode; logic now treats the default visible tab as BULLET when mode equals 1 or the BULLET ID. No public signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/main/java/com/paneedah/weaponlib/crafting/ammopress/GUIContainerAmmoPress.java`:
- Around line 102-107: Update the Javadoc comment in GUIContainerAmmoPress.java
to fix the spelling: change "corisponding" to "corresponding" in the sentence
that references getCraftingMode() and GUIContainerStation.java so the comment
reads correctly about the default tab not showing until its corresponding GUI
button is clicked.
🧹 Nitpick comments (1)
src/main/java/com/paneedah/weaponlib/crafting/ammopress/GUIContainerAmmoPress.java (1)
111-117: Consider initializingcraftingModetoCraftingGroup.BULLET.getID()ininitGui()to eliminate the magic number1.The
|| getCraftingMode() == 1fallback couples this method to the parent class's default initialization value. The existing comment (lines 102–107) acknowledges this constraint, but the initialization can be made explicit and more maintainable.Add the following after line 82:
bulletSelector.toggleOn(); + setCraftingMode(CraftingGroup.BULLET.getID()); + fillFilteredList();Then simplify the condition on line 111:
- if (getCraftingMode() == CraftingGroup.BULLET.getID() || getCraftingMode() == 1) { + if (getCraftingMode() == CraftingGroup.BULLET.getID()) {
src/main/java/com/paneedah/weaponlib/crafting/ammopress/GUIContainerAmmoPress.java
Show resolved
Hide resolved
…tainerAmmoPress.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
📝 Description
This pull request fixes the magizen and grenade crafting functionality of the ammo press by updating the values in GUIContainerAmmoPress.java after PR #540 broke it.
🎯 Goals
Return full crafting functionality to the ammo press.
❌ Non Goals
It is not a goal to cause any bug or make future implementation of additional crafting tabs difficult/impossible without an overhaul or rewrite.
🚦 Testing
⏮️ Backwards Compatibility
Yes, this change is backwards compatible, but not before #540, as this is what caused the bug in the first place
📚 Related Issues & Documents
Fixes: #624 (bug present in MWC 2.0 Dev 5-7)
pull request: #540 (source of initial issue)
🖼️ Screenshots/Recordings
📖 Added to documentation?
😄 [optional] What gif best describes this PR or how it makes you feel?