Skip to content

fix: keep slot display data when placing carried furniture - #30

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/keep-slot-display-on-place
Sep 29, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/keep-slot-display-on-place

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Part of the soup-pot bug report (Hashi): picking up a half-eaten pot of soup and putting it down refills it.

Cause

Furniture.setFromDisplay (placing a carried piece) rebuilt every slot's location and transformation with null display data. Any per-slot display data a plugin had applied was thrown away. For the Cooking pot that is the lowered soup level and the hidden (scale 0) mashed pieces, so the liquid jumped back to full and the pieces showed again. The carry itself already kept the data (followParentTransform uses getCurrentDisplayData()); only the final placement reset it.

Fix

Use slot.getCurrentDisplayData() when re-seating the slots after placement.

Companion: TF-Minecraft/Cooking#54 (the pot losing its soup on chunk reload).

Testing

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

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Corrected furniture display positioning and transformations so they reflect the current data for each active display slot.

Placing a carried piece reset every slot to its default transform. A
plugin's per-slot display data was lost, so a half-eaten pot of soup
refilled to the brim and its hidden mashed pieces showed again.

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: 3496eea6-1e68-4b9f-b8eb-4ae5011b7a3e

📥 Commits

Reviewing files that changed from the base of the PR and between 92df326 and f729b55.

📒 Files selected for processing (1)
  • src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java

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


📝 Walkthrough

Walkthrough

Furniture.setFromDisplay now passes each active slot’s current DisplayData to its display-location and final-transformation calculations when resetting slot origins after placement.

Changes

Placement display reset

Layer / File(s) Summary
Pass display data to slot calculations
src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java
setFromDisplay passes each active slot’s current DisplayData to its display-location and final-transformation calculations instead of null.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to f729b

Placement now preserves each active slot’s display data when recalculating its position and transformation. No concrete merge-blocking risk is evident; the change appears ready for normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to f729b

Placing furniture now keeps its slot appearance instead of resetting it. The reviewed placement path does not appear to grant players new authority. Reload behavior is separate from this fix and remains a limitation.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly retained offset, rotation, and scale affect slot display entities after placement. The examined change does not alter holder identity, placement validation, or a permission decision.

Trust Boundaries and Controls

  • observed — Slot display data can be applied through the slot API and already drives display synchronization. The changed method reuses that stored value rather than accepting display data as a new placement argument.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main fix: preserving slot display data when placing carried furniture.
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 checks each display slot,
Its data now travels to the right spot.
Location and transform receive their share,
As origins reset with careful care.
Hop, hop—the placement path is clear!

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 0c955c6 into main Sep 29, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/keep-slot-display-on-place 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