Skip to content

returned magizen and grenade crafting functionality to the ammo press#627

Open
voroxity wants to merge 4 commits intoCubed-Development:nextfrom
voroxity:voroxity-patch-1
Open

returned magizen and grenade crafting functionality to the ammo press#627
voroxity wants to merge 4 commits intoCubed-Development:nextfrom
voroxity:voroxity-patch-1

Conversation

@voroxity
Copy link
Copy Markdown

@voroxity voroxity commented Feb 8, 2026

📝 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

  1. forked the main up-to-date repository.
  2. Implemented initial fix.
  3. committed changes to a test branch.
  4. compiled and built .jar file.
  5. Replaced the old .jar file with the new edited one.
  6. attempted to replicate the previous issue.
  7. Repeat steps 2-6 untill issue is fixed.

⏮️ 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?

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

😄 [optional] What gif best describes this PR or how it makes you feel?

…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
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 8, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Updated ammo press filtering logic to use CraftingGroup ID comparisons (BULLET, MAGAZINE, GRENADE) instead of numeric literals; default visible tab is treated as BULLET when mode equals 1 or the BULLET ID. Also replaced entryName values "glass""blockGlass" in multiple crafting mapping entries. No public signatures changed.

Changes

Cohort / File(s) Summary
Ammo Press Filter Logic
src/main/java/com/paneedah/weaponlib/crafting/ammopress/GUIContainerAmmoPress.java
Replaced numeric mode checks (1, 2, 3) with CraftingGroup.BULLET.getID(), ...MAGAZINE.getID(), ...GRENADE.getID() in fillFilteredList(). Logic treats mode == 1 as the default BULLET tab and accepts BULLET when mode equals the BULLET ID; added comment about default-tab initialization dependency.
Crafting mappings (glass → blockGlass)
src/main/resources/craftingmappings.json
Replaced multiple recipe entryName values from "glass" to "blockGlass" across numerous mapping entries; no other recipe fields changed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references restoring magizen and grenade crafting to the ammo press, which aligns with the PR's primary objective of fixing the regression introduced by PR #540.
Description check ✅ Passed The description clearly explains the purpose of the PR: fixing magizen and grenade crafting functionality in the ammo press after PR #540 broke it, and relates directly to the changeset.
Linked Issues check ✅ Passed The PR addresses issue #624 by updating GUIContainerAmmoPress.java to restore magazine and grenade crafting UI functionality, and updates craftingmappings.json to fix glass entry references, directly meeting the stated objective.
Out of Scope Changes check ✅ Passed Both changes (GUIContainerAmmoPress.java logic updates and craftingmappings.json glass entry name changes) are directly related to restoring magazine/grenade crafting and resolving issue #624.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 initializing craftingMode to CraftingGroup.BULLET.getID() in initGui() to eliminate the magic number 1.

The || getCraftingMode() == 1 fallback 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()) {

…tainerAmmoPress.java

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@strubium strubium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

It is not possible to craft any of the magazines

2 participants