Skip to content

fix: keep saucepan sauce scoopable after a chunk reload - #69

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/saucepan-reload
Oct 10, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/saucepan-reload

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A player left sauce in a saucepan, came back later, and could no longer pick it up with a ladle.

When a chunk unloads (everyone walks away) or the server restarts, CookingManager drops the station reference and rebuilds it from the furniture on the next load. SauceReference used the base rebuildFromFurniture, which only keeps raw cookable food. The saucepan's liquid was not restored, so scoop() returned at if (!secondaries.containsKey("liquid")) return; with no message while the sauce was still shown. Seasonings and other additions were forgotten too. Pots already got this fix in PotReference.rebuildFromFurniture; saucepans did not.

Changes

  • SauceReference.rebuildFromFurniture restores the liquid, the added ingredients (any food in an input slot) and the colours.
  • Pouring and adding ingredients save the colour list (sauce.colours) and the poured liquid (sauce.liquid) in the furniture's variables; clear() removes them. A milk-bucket sauce (the only liquid coloured white) therefore stays creamy, and the liquid still counts toward the scoop's quality after a reload.
  • Saucepans filled before this change have no saved colours, so they fall back to their ingredients' colours (the liquid's own colour is unknown for them).

Testing

  • mvn clean verify passes (100% line coverage gate). New SauceReferenceReloadTest covers the rebuild with saved state, legacy saucepans, ingredients without liquid, non-food liquid and missing furniture.
  • Dev bot test (~/sauce-test/reload-test.js on the host) against TFMCDev01: all checks pass. A milk + basil sauce and a water + basil sauce are each scooped after their chunk unloads and loads again, and the reloaded sauce matches the same batch scooped without a reload. On 0.3.21 the same test returned an empty ladle after the reload. (Cups of milk give colour 000000, not white, with or without a reload. That is existing behaviour, not part of this fix.)

🤖 Generated with Claude Code

A chunk unload or restart rebuilds the saucepan from its furniture, but
the rebuild only kept raw food. The liquid was dropped, so the saucepan
still showed sauce that the ladle could no longer scoop, and seasonings
and other additions were forgotten.

Restore the liquid and the added ingredients on rebuild, and save the
sauce colours and the poured liquid in the furniture's variables so a
milk sauce stays creamy. Saucepans filled before this fall back to their
ingredients' colours.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: 28549c3c-5eb5-4423-a955-415a5b86a6ed

📥 Commits

Reviewing files that changed from the base of the PR and between 24c2ddb and 31caa66.


📒 Files selected for processing (2)
  • src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java
  • src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceReloadTest.java

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
    • Saucepan contents and colours are now retained when furniture is rebuilt, including poured liquids and added ingredients.
    • When saved colour information is unavailable, saucepan colours are restored based on the ingredients.
    • Saucepan contents are cleared when the associated reference is cleared, and missing or unsupported liquids are not restored.

Walkthrough

SauceReference now saves saucepan colours and liquid item data in furniture variables. It restores ingredient slots, liquid data and colours when rebuilding from furniture. Tests cover reconstruction, scooping, clearing and cases with missing or unsupported liquid data.

Changes

Saucepan state persistence

Layer / File(s) Summary
Save and clear saucepan state
src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java
SauceReference saves colours and encoded liquid item data to furniture variables as saucepan contents change. Clearing removes the saved values and marks the furniture dirty.
Restore and test saucepan state
src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java, src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceReloadTest.java
Rebuilding restores ingredient slots, the liquid and saved colours. If saved colours are absent, SauceReference derives them from restored ingredients. Tests cover serving and cleanup, older state, absent or non-food liquid, and missing furniture.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97


Merge Risk: ⚪ Minimal · up to 31caa

Saucepan liquid, ingredients and colours are now saved and restored after a chunk reload, and tests cover the edge cases. No outstanding risk blocks merging. A saucepan filled before this change with only liquid will still scoop after reload, using a default colour.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 57b4591 into main Oct 10, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/saucepan-reload branch October 10, 2026 17:29
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