Skip to content

Fix bulk trading with unstackable and high-cost payments - #1

Open
playeriv65 wants to merge 1 commit into
BackupBackupFede:mainfrom
playeriv65:fix/refill-after-merchant-trade
Open

playeriv65 wants to merge 1 commit into
BackupBackupFede:mainfrom
playeriv65:fix/refill-after-merchant-trade

Conversation

@playeriv65

Copy link
Copy Markdown

Shift-clicking a boat-for-emerald trade currently sells only one boat, even when more boats are available in the inventory. The same problem affects prices above half a stack and unstackable items in the second payment slot.

The refill runs at the start of quickMoveStack. After a trade exhausts its payment, vanilla clears the result slot and ends the shift-click loop before quickMoveStack can run again.

This change wraps quickMoveStack, retains the active offer, and refills payment slots after a successful trade, before vanilla checks whether to continue. It leaves the actual transaction to vanilla and preserves offer stock limits. Failed output moves do not trigger a refill.

Validation on Fabric / Minecraft 26.3:

  • Before the fix: six boats yield only one emerald; high-cost and unstackable second-payment cases also fail.
  • After the fix: all six self-test cases pass: ordinary stackable payments, boats, offer stock exhaustion, 40-emerald payments, an unstackable second payment, and a full inventory.
  • BULKTRADE_SELFTEST=true ./gradlew :fabric:runServer :fabric:build completes with [SELFTEST] RESULT PASS.

The self-tests run against the real merchant menu with the mixin applied, using the existing shift-click test helper. Other Minecraft versions and NeoForge have not been runtime-tested locally. No manual client playtest has been performed.

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.

1 participant