Skip to content

Add native furniture variant cloning - #264

Merged
ifBars merged 3 commits into
stablefrom
diffuin/236-18fb5df1
Aug 14, 2026
Merged

ifBars merged 3 commits into
stablefrom
diffuin/236-18fb5df1

Conversation

@diffuin

@diffuin diffuin Bot commented Aug 12, 2026

Copy link
Copy Markdown

Requested by @ifBars in #236.

Diffuin response

Confidence: Medium

Implemented native furniture variant cloning. The additive API safely clones presentation-only grid or surface donors, preserves donor placement and item defaults, isolates materials, and routes the customized visual through placed, stored, ghost, and generated-icon representations. Repository compilation remains unverified because the checkout environment has no .NET SDK.

Recommended next steps

  1. Callbacks run once against an unparented, builder-owned visual clone whose renderer materials are already independent from native assets.
  2. Placed, stored, ghost, and icon visuals each receive separate material instances.
  3. Existing CreateBuilder and WithModel behavior remains unchanged; material isolation is enabled only for native variants.
Evidence and validation

Evidence inspected

  • Added FurnitureCreator.CloneFrom(string) and CloneFrom(BuildableItemDefinition), plus ConfigureModel(Action<GameObject>).
  • Donors using specialized GridItem or SurfaceItem subclasses are rejected; non-presentation components are removed before the callback receives the clone.
  • Exact donor grid coordinates or surface settings are preserved by default, alongside build sound, pricing, stack limit, and donor icon fallback.
  • Added API compatibility, compile-fixture, clone-policy, copied-default, override, and sound-mapping coverage, plus native-variant documentation.

Validation performed

Runtime validation remaining

  • Run MonoMelon and Il2CppMelon restore, solution build, and test commands. dotnet is not installed in this environment.
  • Run DocFX, documentation coverage, and ApiCompat against the exact target assembly.
  • Validate representative grid and surface donors in both game backends, including material isolation, placement, storage, generated icons, save restoration, multiplayer placement, and late join.
Diffuin run details
  • Provider: codex
  • Model: gpt-5.6-sol
  • Reasoning: high (Luna advisor: risk (high); baseline bounded implementation)
  • Elapsed: 1162s
  • Codex thread: 019ff7b6-c147-7c33-85c3-f81baafd81d7

AI notice: Generated with AI assistance and not guaranteed accurate. Verify findings and plans against the current source and runtime.

Closes #236


Diffuin job: 18fb5df1-6b62-48bc-be63-406ffd49c67e
Commit: 5bf52188959cde3a8d89133fb036fd239aa24f98

@ifBars

ifBars commented Aug 14, 2026

Copy link
Copy Markdown
Owner

@coderabbitai review plz

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

@ifBars I will review pull request #264.


🧠 Learnings used
Learnt from: ifBars
Repo: ifBars/S1API PR: 233
File: S1API/Items/Buildable/FurniturePlacementMode.cs:6-12
Timestamp: 2026-08-09T09:57:18.710Z
Learning: For the C# `S1API.Items.Buildable.FurnitureDefinitionBuilder` API, this PR intentionally supports only `FurniturePlacementMode.Grid` and `FurniturePlacementMode.Surface`. Do not request a procedural-grid furniture mode unless a stable generic native procedural-grid furniture donor and composition contract have been verified. `BuildableItemDefinitionBuilder.WithGhostVisual(...)` already supports ghost customization for non-furniture procedural-grid buildables.

Learnt from: ifBars
Repo: ifBars/S1API PR: 233
File: S1API.Tests/Items/FurnitureApiCompatibilityTests.cs:10-66
Timestamp: 2026-08-09T09:57:39.503Z
Learning: For custom furniture in `S1API.Items.Buildable.FurnitureDefinitionBuilder`, duplicate registration behavior is delegated to the existing `BuildableItemDefinitionBuilder` and native item registry. Native save/load and multiplayer restoration require runtime-native validation, rather than managed wrapper unit fakes. Every multiplayer peer must register the same furniture definition.
⚠️ Action not completed

Review rate limited.

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.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@ifBars, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 73b00581-7de9-4919-b1fb-7986db52faee

📥 Commits

Reviewing files that changed from the base of the PR and between 0e84659 and 904d3d2.

📒 Files selected for processing (14)
  • S1API.Tests/Items/FurnitureApiCompatibilityTests.cs
  • S1API.Tests/Items/FurnitureApiCompileFixture.cs
  • S1API.Tests/Items/FurnitureClonePolicyTests.cs
  • S1API/Internal/Building/FurnitureBuildSoundMapper.cs
  • S1API/Internal/Building/FurnitureClonePolicy.cs
  • S1API/Internal/Building/FurnitureCloneSource.cs
  • S1API/Internal/Building/FurnitureIconRuntime.cs
  • S1API/Internal/Building/FurniturePrefabComposer.cs
  • S1API/Internal/Building/FurnitureVisualCloner.cs
  • S1API/Internal/Utils/CrossType.cs
  • S1API/Items/Buildable/FurnitureCreator.cs
  • S1API/Items/Buildable/FurnitureDefinitionBuilder.cs
  • S1API/docs/furniture-items.md
  • S1API/docs/item-builder-reference.md

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.

@ifBars

ifBars commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Verified against clean isolated completed-save copies on both Mono and IL2CPP. Runtime coverage includes native registration before load, grid and surface donor defaults, built/stored/ghost presentation, per-representation material isolation, donor immutability, and generated icon replacement. Verification found and fixed two blockers in 04606c4: IL2CPP presentation-component type checks now use the native-aware CrossType seam, and icon requests persist until the gameplay render rig exists. Full suites: Mono 603/603; IL2CPP 592/592.

@ifBars
ifBars merged commit 26138d3 into stable Aug 14, 2026
6 checks passed
@ifBars
ifBars deleted the diffuin/236-18fb5df1 branch October 2, 2026 02: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.

[FEATURE] Support customizable variants of native furniture

1 participant