You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: stack aging foods consistently on inventory clicks - #77
Matching Cooking foods can stop stacking while an inventory is open because their hidden aging data differs. Inventory clicks now merge compatible food stacks using the older food's data, regardless of which stack is on the cursor.
Support left-click, single-item right-click, and shift-click transfers in player inventories and ordinary storage containers.
Respect stack limits and preserve excess items, different qualities, freshness stages, and other item metadata. Honor cancelled events, character readiness, restricted slots, and custom inventory holders.
Documentation impact
Central Cooking documentation: no change; fixes existing stacking behavior without changing configuration or commands.
Contract
Affected behavior: manual Cooking food stacking in player inventories, chests, barrels, ender chests, and shulker boxes. Machine inventories and custom inventory holders retain their own handling.
Tests: tfmc-mvn -o -B clean verify — 1,148 tests, zero failures/errors/skips; coverage gate passed. Includes 22 new regression cases covering both cursor directions, right-click amounts, shift transfers, full inventories, age preservation, and protected item/slot differences. The initial regression suite reproduced eight failures before the fix.
Player wiki (ProvinceSystem/wiki/cooking): no change.
Notes
Automated verification uses MockBukkit; no live Paper/client test or deployment has been performed.
The reported screenshot did not identify the item type. This fixes the demonstrated Cooking path; it does not establish that other quality-item systems are affected.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Summary
Summary by CodeRabbit
New Features
Compatible food stacks can now be combined in supported storage inventories. Left-click moves as much as fits, while right-click moves one item.
Shift-clicking combines food with matching stacks and uses empty slots for any remainder.
When food is combined, its freshness and other item details are preserved, using the more-aged stack’s freshness. Items with different quality, details or freshness remain separate.
The change adds food-aware handling for left-click, right-click and shift-click actions in supported inventories. It checks player context, inventory types, holders and slots before handling clicks. MockBukkit tests cover merging, movement and cases that remain unchanged.
Changes: Food inventory stacking
Layer / File(s)
Summary
Click eligibility and food merging src/main/java/net/tfminecraft/cooking/manager/ConversionManager.java, src/test/java/net/tfminecraft/cooking/manager/FoodInventoryClickTest.java
Click handling checks player context, supported inventories, holders and slots. Compatible food merges while retaining the more-aged stack's data. Tests cover click merges, stack limits, incompatible items, and ignored clicks.
Shift-click food movement src/main/java/net/tfminecraft/cooking/manager/ConversionManager.java, src/test/java/net/tfminecraft/cooking/manager/FoodInventoryClickTest.java
Shift-clicks fill compatible stacks before empty slots. Unplaced items remain at the source. Tests cover movement between chest and player inventories, including limited capacity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:L100-499 effective changed lines (tests excluded in mixed PRs).
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Matching Cooking foods can stop stacking while an inventory is open because their hidden aging data differs. Inventory clicks now merge compatible food stacks using the older food's data, regardless of which stack is on the cursor.
Documentation impact
Contract
tfmc-mvn -o -B clean verify— 1,148 tests, zero failures/errors/skips; coverage gate passed. Includes 22 new regression cases covering both cursor directions, right-click amounts, shift transfers, full inventories, age preservation, and protected item/slot differences. The initial regression suite reproduced eight failures before the fix.ProvinceSystem/wiki/cooking): no change.Notes