Repository navigation
fix: deliver node output into the hopper above the node - #22
Conversation
Output previously fell as loose items onto the hopper, so a block above it trapped the items where they despawned while the menu still reported a successful cycle. Insert the output into the hopper inventory as one transaction; a full hopper restores its contents and holds the cycle for retry. The loose drop remains when no hopper is present.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
A full hopper previously left the cycle to be rerolled on each retry, so blocked output could complete empty or skewed toward whatever fitted. Store the rolled result on the node and in its saved JSON until delivery succeeds, and play the delivery sound only after the whole output is inserted.
Deactivation returns the current cycle's inputs, so a held output kept from that cycle would be delivered for free after reactivation. Clear it once refunds drain the pending inputs; incomplete refunds keep it for the retry, and no refund means the output stays paid for.
Activation now delivers held output before taking new inputs, so a later deactivation refund cannot cancel output earned by an earlier cycle; a hopper that still cannot hold it blocks activation with an error. Breaking a node drops its held output with the node item, so deletion and guild-loss cleanup return the items instead of discarding them.
Two stale menus could both run the removal path, dropping the node item and its held output twice. Mark the node broken on the first break and consume the held output as it is dropped, so repeated removal from any caller is a no-op.
A node removed by validation could still be deactivated from a stale menu, refunding its inputs after its held output had already dropped. Broken nodes now reject activation, deactivation and refunds, and inventory clicks for nodes no longer in the registry close the stale menu without acting. Menu test fixtures now register their node, matching the production invariant.
Fixes a player ticket: a guild node reported successful cycles but produced nothing. The node menus showed extracted items while the loose output items spawned inside a chest placed on top of the hopper, landed where the hopper could not reach them, and despawned in the force-loaded chunk.
Review: six Sol review rounds, approved at
311a7b5with no remaining in-scope findings.Validation:
tfmc-mvn -o -B clean verifypassed (233 tests, zero failures/errors/skips), including hopper delivery, full-hopper rollback, held-output, refund-cancellation, activation settlement, persistence, and stale-menu regression tests and the 100% line-coverage check.git diff --checkpassed.Documentation: TF-Minecraft/Docs#269.