Skip to content

Allow enumerated crafting interfaces to update every 5 ticks - #256

Open
rubensworks wants to merge 1 commit into
master-1.21-ltsfrom
enumerated-interface-update-interval
Open

rubensworks wants to merge 1 commit into
master-1.21-ltsfrom
enumerated-interface-update-interval

Conversation

@rubensworks

Copy link
Copy Markdown
Member

Closes #253

The enumerated crafting interface had a 20-tick minimum update interval because reading a list of recipes is expensive. But the list is only re-read when its variable is invalidated, so for a static list the 20-tick minimum only slowed down job processing.

Instead of detecting static lists, this change:

  • gives the enumerated interface the regular minimum update interval (minCraftingInterfaceUpdateFreq, 5 ticks),
  • throttles only the recipe list reloads to at most once every minCraftingInterfaceEnumeratedUpdateFreq ticks (still 20 by default). The config key is unchanged, only its description is updated.

Static lists are never reloaded, so they get the full 5-tick rate. Reader-backed lists keep the bounded reload cost.

Side effects:

  • A change to a reader-backed list can take up to 20 ticks longer to be picked up.
  • Already placed interfaces keep their stored 20-tick interval until players lower it in the part settings.

Testing:

  • Added game test testItemsCraftEnumeratedMinUpdateInterval.
  • ./gradlew build passes; ./gradlew runGameTestServer: all 83 tests pass.

Generated by Claude Code

Instead of raising the minimum update interval of enumerated crafting
interfaces, only reloads of their recipe list are throttled now. Static
lists are never reloaded, so they process jobs as fast as regular
crafting interfaces.

Closes #253

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UeSuG8KEf7iLTGPVRTnQX3
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.

2 participants