Skip to content

fix: keep pot soup through chunk reloads and restarts - #54

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/pot-soup-reload
Sep 29, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/pot-soup-reload

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Bug report (Hashi): a pot of soup at 1/3 that was left to sit "bugs out". The ladle can't scoop and gets set on the pot instead, picking the pot up refills it, and breaking it gives every ingredient back.

Cause

CookingReference.rebuildFromFurniture keeps raw food only. A soup's pieces are mashed and boiled (cooked = 3), so any rebuild drops them from the pot's state even though they stay in the furniture slots. A rebuild happens on every restart and, since 0.3.10 (#53), on every chunk reload. So walking away from a pot is enough.

After the rebuild isSoup() is false, so:

  • the ladle click isn't cancelled, and InteractibleFurniture places the ladle on the ladle_slot rest (slotAdd also threw an NPE on the non-food ladle)
  • breaking the pot runs remove() instead of clear(), so the input slots drop every ingredient

Fix

  • PotReference.rebuildFromFurniture restores the input slots holding mashed or pot-boilable food, hides the mashed pieces again, and rebuilds the colour list (water first, then the ingredients).
  • CookingReference.slotAdd ignores non-food items the slot whitelists (the ladle rest) instead of throwing.
  • Unit test for which pieces a rebuild keeps.

The "refills itself" part on carry is fixed in InteractibleFurniture (placing a carried piece reset every slot's display data): TF-Minecraft/InteractibleFurniture companion PR.

Testing

  • mvn clean verify passes locally.
  • Tested on TFMCDev01 (see comment).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Non-food items placed in compatible furniture slots are no longer interrupted by cooking checks.
    • Rebuilding a pot now restores eligible ingredients, preserves its colors and soup level, and keeps mashed ingredients displayed correctly.
    • Pot contents that cannot be cooked using the pot method are no longer retained during rebuilding.

A rebuilt pot reference kept raw food only. Mashed soup and boiled
pieces were dropped from its state after any chunk reload (every chunk
unload since 0.3.10) or restart, so:
- the ladle found no soup and was set on the pot's ladle rest instead
- breaking the pot dropped every soup ingredient back
- carrying it showed the pieces and full liquid again

The pot now restores mashed and boilable pieces, re-hides the mash and
rebuilds its colours. Placing a non-food item such as the ladle on a
cooking slot no longer throws.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 399e5299-2f3c-4058-85e1-1d4fa77c0b8e

📥 Commits

Reviewing files that changed from the base of the PR and between 388ccb8 and f280f73.

📒 Files selected for processing (3)
  • src/main/java/net/tfminecraft/cooking/cooking/CookingReference.java
  • src/main/java/net/tfminecraft/cooking/cooking/PotReference.java
  • src/test/java/net/tfminecraft/cooking/item/PotMashTest.java

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Cooking slot handling now ignores non-food items without cancelling the event. Pot rebuilding restores eligible main ingredients and colours, reapplies the soup level, and uses shared display data for mashed ingredients.

Changes

Cooking Slot Handling

Layer / File(s) Summary
Non-food item guard
src/main/java/net/tfminecraft/cooking/cooking/CookingReference.java
slotAdd returns when the added item is not a FoodItem. It does not cancel the event.

Pot Rebuild

Layer / File(s) Summary
Restore pot contents and display state
src/main/java/net/tfminecraft/cooking/cooking/PotReference.java, src/test/java/net/tfminecraft/cooking/item/PotMashTest.java
Pot rebuilding restores eligible main ingredients, reconstructs colours, and reapplies the soup level. Mashed ingredients use shared display data. Tests cover which food is retained during rebuild.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to f280f

The change appears ready to merge after normal checks; no actionable risk remains from the reviewed slot-handling and pot-rebuild paths.

Security Architecture Review

Security architecture risk: 🔵 Low · up to f280f

The reviewed paths restore soup state without showing a new privilege or cross-player access path. Risk remains low, though furniture-side slot enforcement and the full restart path were not verified here.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The identified player-facing effect is confined to furniture-slot additions and the state of affected pots; the reviewed event path does not establish a new service or privilege boundary.

Trust Boundaries and Controls

  • inferred — CookingReference continues to enforce cooking checks for food, while uncancelled non-food placement depends on furniture-side slot enforcement; that enforcement was not directly verified.

Resilience and Maintainability Implications

  • observed — Rebuild derives cooking slots from active furniture slots before soup detection and cleanup use them, addressing the lifecycle mismatch described by the PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: preserving pot soup through chunk reloads and server restarts.
Description check ✅ Passed The description is detailed and relevant. It explains the bug, cause, fix, affected behavior, and testing. It does not use the repository template headings and omits explicit documentation impact, Pla…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit stirs the pot with care,
Food returns to slots once more.
Water leads the colours there,
Mashed bits hide along the floor.
The soup level settles in its place,
And carrots dance at a gentle pace.

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

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Tested on TFMCDev01 with both fix jars (Cooking #54 + InteractibleFurniture #30), mineflayer bot ~/pot-test/test.js: lit oven, pot, water, carrot, mash, scoop 1, walk away until the chunk unloads (execute unless loaded), come back.

Check 0.3.10 / 0.2.6 fix
ladle scoops after the chunk reload FAIL (ladle placed on the pot) PASS (Carrot Soup, colour kept)
liquid drops another step FAIL PASS
carry + place keeps the soup level FAIL (back to full, mashed carrot visible) PASS
breaking returns no soup ingredients FAIL (Carrot dropped) PASS (pot only)

No Cooking/InteractibleFurniture errors in latest.log.

@XxFran10xX
XxFran10xX merged commit 6ee9e89 into main Sep 29, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/pot-soup-reload branch September 29, 2026 14:44
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