Skip to content

fix: keep other plugins' slot display for food on their furniture - #59

Merged
JustinasLa merged 1 commit into
mainfrom
fix/food-display-on-foreign-furniture
Sep 30, 2026
Merged

JustinasLa merged 1 commit into
mainfrom
fix/food-display-on-foreign-furniture

Conversation

@JustinasLa

@JustinasLa JustinasLa commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Salt (and any other cooking food) placed on a magic pedestal or artifact_display shows flat and full size instead of the pedestal's tilted 0.6-scale pose.

PlateManager.addItem had a stray semicolon after its check:

if(FurnitureCache.isMealHolder(f));

So the check did nothing, and the cooking display data from models.yml replaced the slot display on every InteractibleFurniture piece.

Fix

  • PlateManager.addItem returns early unless the furniture is Cooking-owned.
  • FurnitureCache.isCookingFurniture treats furniture whose item path starts with ia.tfmc_cooking: as Cooking-owned.
  • Cooking furniture is unchanged. Other plugins' furniture keeps its own slot display.

Testing

  • mvn clean verify: 274 tests, 0 failures.
  • New CookingFurnitureTest checks that a plate counts as Cooking furniture, a pedestal doesn't, and furniture with no type doesn't.

Items already placed keep their old pose until they're taken off and placed again.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Slot items are now added only to cooking furniture, preventing them from being processed for other furniture types.
  • Tests
    • Added coverage for identifying cooking furniture and rejecting unrelated furniture or furniture without a type.

PlateManager.addItem had a stray semicolon after its furniture check, so
every food item placed on any InteractibleFurniture slot got the cooking
display pose (flat, full size). Salt on magic pedestals showed oversized.
Only apply cooking display data to Cooking-owned furniture.

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

coderabbitai Bot commented Sep 30, 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: a824473d-a273-489e-9bda-f0921737a38e

📥 Commits

Reviewing files that changed from the base of the PR and between aa4601a and 6f6b4ac.

📒 Files selected for processing (3)
  • src/main/java/net/tfminecraft/cooking/cache/FurnitureCache.java
  • src/main/java/net/tfminecraft/cooking/manager/PlateManager.java
  • src/test/java/net/tfminecraft/cooking/cache/CookingFurnitureTest.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

The change adds a cooking-furniture check and uses it to restrict item additions in PlateManager. Tests cover cooking furniture, other furniture, and furniture with no type.

Changes

Cooking Furniture Handling

Layer / File(s) Summary
Furniture recognition and plate gating
src/main/java/net/tfminecraft/cooking/cache/FurnitureCache.java, src/main/java/net/tfminecraft/cooking/manager/PlateManager.java, src/test/java/net/tfminecraft/cooking/cache/CookingFurnitureTest.java
FurnitureCache.isCookingFurniture checks for a non-null type and an item path that starts with ia.tfmc_cooking:. PlateManager.addItem returns for furniture that does not pass this check. Tests cover accepted and rejected cases.

Priority: ➖ Normal

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to 6f6b4

The change keeps food on other plugins' furniture using that furniture's own slot display, while Cooking furniture is handled as before. No merge-blocking risk was identified.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 6f6b4

The change limits display overrides to Cooking-namespaced furniture rather than expanding access or privileges. No newly introduced security concern was established. Some uncertainty remains because furniture identity and slot-addition recovery are controlled by an external dependency.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed operation’s direct scope is food display metadata on furniture slot-addition events within the plugin runtime. The accepted namespace receives the same display operation as before; other furniture no longer receives this override.

Security Findings and Attack Paths

  • inferred — No newly expanded display-mutation path is established by the change. Even if an external actor could supply a Cooking-namespaced type, that furniture already reached the same assignment under the prior ineffective condition. This comparison does not establish that the external identity mechanism is trustworthy.

Trust Boundaries and Controls

  • inferred — The early return reduces Cooking’s interference with foreign furniture presentation. Authority over the furniture type’s item path remains external, and namespace authenticity was not verified; the predicate should therefore be understood as display-ownership routing rather than a proven authorization boundary.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 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 identifies the main change: preserving other plugins' furniture slot displays for food.
Description check ✅ Passed The description clearly explains the problem, fix, affected behavior, testing performed, and item migration behavior. It does not use the repository template headings and omits explicit Documentation …
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 the plate with care
The cooking furniture passes there
Other paths are turned away
Tests confirm the checks today
I nibble greens and hop away

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

@JustinasLa
JustinasLa merged commit 981db2c into main Sep 30, 2026
2 checks passed
@JustinasLa
JustinasLa deleted the fix/food-display-on-foreign-furniture branch September 30, 2026 10:03
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