Skip to content

Move InventoryTab system out of weaponlib#629

Open
strubium wants to merge 2 commits intonextfrom
strubium/tabs
Open

Move InventoryTab system out of weaponlib#629
strubium wants to merge 2 commits intonextfrom
strubium/tabs

Conversation

@strubium
Copy link
Contributor

📝 Description

Extracts the InventoryTab's from weaponlib and improves javadoc

🎯 Goals

  • Move InventoryTab's out of weaponlib
  • Make the system easier to understand

❌ Non Goals

  • Mod compatibility
  • Large sweeping changes

🚦 Testing

Launch singleplayer, equip backpack, add item to backpack, save and reload to make sure its still there

⏮️ Backwards Compatibility

Yes

📚 Related Issues & Documents

N/a

🖼️ Screenshots/Recordings

2026-02-11_20 29 24 2026-02-11_20 29 55

📖 Added to documentation?

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

@strubium strubium requested a review from Desoroxxx February 12, 2026 02:30
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

Moved inventory GUI classes from com.paneedah.weaponlib.inventory into com.paneedah.mwc.gui.inventory, renamed InventoryTabsInventoryTabHandler, removed ModContext constructor parameters from some tabs, and updated imports/usages across callers to use the new package/names and local rendering changes.

Changes

Cohort / File(s) Summary
Inventory GUI Package Migration
src/main/java/com/paneedah/mwc/gui/inventory/BackpackInventoryTab.java, src/main/java/com/paneedah/mwc/gui/inventory/CustomPlayerInventoryTab.java, src/main/java/com/paneedah/mwc/gui/inventory/InventoryTab.java, src/main/java/com/paneedah/mwc/gui/inventory/StandardPlayerInventoryTab.java
Classes moved to com.paneedah.mwc.gui.inventory. Removed ModContext constructor parameters from BackpackInventoryTab and CustomPlayerInventoryTab. InventoryTab removed itemRenderer field and now uses a local RenderItem in drawButton. shouldAddToList() behavior adjusted in tabs.
InventoryTabs → InventoryTabHandler Refactor
src/main/java/com/paneedah/mwc/gui/inventory/InventoryTabHandler.java
Renamed class and singleton from InventoryTabs to InventoryTabHandler; updated constructor, instance field, and getInstance() signature. Package changed to com.paneedah.mwc.gui.inventory.
Callsite & Import Updates
src/main/java/com/paneedah/mwc/equipment/inventory/GuiEquipment.java, src/main/java/com/paneedah/mwc/equipment/inventory/carryable/backpack/GuiBackpack.java, src/main/java/com/paneedah/mwc/proxies/ClientProxy.java, src/main/java/com/paneedah/weaponlib/ClientModContext.java
Replaced imports from weaponlib.inventory with mwc.gui.inventory. Replaced InventoryTabs.getInstance() calls with InventoryTabHandler.getInstance() and updated tab constructor calls to match new signatures.
GuiHandler Package Move & Import Adjustments
src/main/java/com/paneedah/mwc/gui/GuiHandler.java, src/main/java/com/paneedah/weaponlib/CommonModContext.java, src/main/java/com/paneedah/weaponlib/WeaponKeyInputHandler.java, src/main/java/com/paneedah/weaponlib/crafting/ammopress/BlockAmmoPress.java, src/main/java/com/paneedah/weaponlib/crafting/workbench/WorkbenchBlock.java
Updated package declaration for GuiHandler and adjusted import paths where GuiHandler is referenced. Mostly import/path-only changes with no functional edits.
Client-side tab registration updates
src/main/java/com/paneedah/mwc/proxies/ClientProxy.java
Switched from legacy inventoryTabs variable to inventoryTabHandler; updated registerTab calls and adjusted tab constructor arguments to new signatures (BackpackInventoryTab() and CustomPlayerInventoryTab(Item)).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Desoroxxx
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: moving the InventoryTab system from weaponlib to mwc.gui packages.
Description check ✅ Passed The description clearly explains the PR's goals, testing strategy, and backwards compatibility, directly related to the changeset of extracting InventoryTab classes from weaponlib.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch strubium/tabs

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.

❤️ Share

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant