Skip to content

Process and integrate upstream SmithingPlus pull requests - #5

Draft
AzureTai wants to merge 15 commits into
masterfrom
agent/process-upstream-prs
Draft

Process and integrate upstream SmithingPlus pull requests#5
AzureTai wants to merge 15 commits into
masterfrom
agent/process-upstream-prs

Conversation

@AzureTai

Copy link
Copy Markdown
Owner

Current integrations

Pending before this PR can leave draft

The original SmithingPlus domain remains unchanged at this stage.

skorpnok and others added 15 commits June 2, 2026 22:39
Synchronize runtime ServerConfig with Server when joining
fix some behaviours getting added twice
…dlists

BlockAnvil.GetPlacedBlockInteractionHelp queries GetRequiredAnvilTier for
every handbook stack of every IAnvilWorkable item. With
CollectibleBehaviorCastToolHead attached to everything matching
ToolHeadSelector, each query resolved the metal material from scratch:

- The ItemStack overload of GetOrCacheMetalMaterial bypassed the material
  cache for all behavior-based workables (any collectible whose class is
  not IAnvilWorkable), calling the uncached resolver every time.
- Failed resolutions (null) were never cached, so items with no metal
  material re-ran the full fallback on every call.
- The fallback linearly scanned all smithing recipes and all grid
  recipes x ingredients per call.

Fix: route both fallback paths of the ItemStack overload through the
collectible-level cache; cache negative results once MetalMaterialLoader
has resolved its materials (new MaterialsResolved flag prevents
premature nulls from poisoning the cache); and replace the linear recipe
scans in GetSmithingRecipe, GetSmithingRecipesAsIngredient and
GetGridRecipesAsIngredient with one-time reverse indexes keyed by
collectible code, built lazily via ObjectCacheUtil.

On a large modlist this cuts the first anvil tooltip from ~2 minutes of
freeze to ~200 ms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add comment suggested by coderabbitai.
Import and preserve the client/server configuration split from jayugg/SmithingPlus PR jayugg#130.

Original PR: jayugg#130
Original author: skorpnok

Separates client display preferences from server-authoritative mechanics, synchronizes server configuration on join, prevents duplicate behavior registration, and migrates client preferences from the legacy shared configuration.

This commit is intentionally staged before the performance PRs because subsequent work must use the corrected configuration ownership model.

Validation status: source integration only; compilation and Vintage Story 1.22.5 runtime testing are pending.
Import the profiled anvil interaction-help performance correction from jayugg/SmithingPlus PR jayugg#132.

Original PR: jayugg#132
Original author: Maeyanie

Adds reusable reverse indexes for smithing outputs, smithing ingredients and grid ingredients; routes ItemStack material fallbacks through the collectible cache; and caches resolved negative material results only after AssetsFinalize completes.

Reported upstream measurement reduced the first anvil tooltip delay from approximately two minutes to approximately 200 milliseconds on a large mod set.

Validation status: upstream profiling retained as evidence; fork compilation, standards audit and Vintage Story 1.22.5 runtime testing remain pending.
Record the disposition of every upstream SmithingPlus pull request reviewed for the performance fork, including superseded work, baseline inclusions, staged conflicts, integrated commits and the pre-rename validation gate.
Add explicit validation for unresolved recipe outputs, empty item slots, optional collectible attributes, voxel-pattern rows and JSON-populated material overrides. Replace warning-prone recipe ordering pipelines with guarded iteration while preserving the existing selection semantics.
Restore repository-standard LF line endings in the warning-cleanup files so subsequent review shows only substantive source changes.
Adopt the supplied working Vintage Story 1.22/.NET 10 project skeleton, including the Anego ZZCakeBuild project, solution files, launch profiles and build wrappers. Pin development metadata to Vintage Story 1.22.5 and exclude generated IDE, build and release output through the project-specific gitignore.
Validate recipe objects independently from their resolved outputs and handle an absent collectible attribute token before mutation. This resolves the remaining nullable-flow warnings reported by the Vintage Story 1.22.5 build.
Delete the unfinished stone-smithing renderer postfix whose entry point returned unconditionally and whose mesh helper had no callers. This removes the final compiler warning and avoids registering a no-op Harmony patch without changing reachable behaviour.
Add explicit guards for unresolved recipes, missing metal materials and bit items, empty slots, absent mold outputs, reflection failures, and mod lifecycle state. Remove the remaining null-forgiving recipe assertion and nullable warning pragma. ZZCakeBuild is unchanged.

Static validation: git diff --check passed. Compilation was not available in the publishing container and requires verification against the local Vintage Story 1.22.5 installation.
Treat RecipeIngredientConsumeProperties as the non-null value supplied by the Vintage Story API, retain the resolved ingredient stack in a validated local, and match the nullable ItemSlot signature of CollectibleBehavior.GetHeldItemInfo.
Match the nullable ItemSlot contract for broken-tool item information and reject missing Harmony DamageItem context before accessing the entity or inventory slot.
Declare the Harmony-supplied world, entity, and item slot as nullable and validate all three before use. This gives nullable flow analysis the same contract enforced at runtime.
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.

3 participants