Allow aspect settings to be determined by variables - #1707
Merged
rubensworks merged 4 commits intoAug 30, 2026
Conversation
Every aspect setting now has an optional variable slot in the aspect settings gui, similar to the variable slots of the part offset gui. When a variable is present, its value overrides the statically configured value of that setting. Closes CyclopsMC/IntegratedTunnels#278 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEB2eDBd8VaFgqeJRwaSyk
The value shown for a variable-driven aspect setting is now the value that its variable currently produces, so that players can inspect what a variable evaluates to. The same values are shown in the aspect properties tooltip of the part gui, and both are refreshed continuously. Also center the variable slot in the aspect settings gui. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEB2eDBd8VaFgqeJRwaSyk
rubensworks
force-pushed
the
claude/aspect-settings-variable-slots-fdjwp3
branch
from
August 28, 2026 18:42
1045e6d to
c0671c1
Compare
The tooltip only used the property values that the server syncs. The statically configured values can be determined client-side as well, as they are part of the part state that is synced anyway, so they are now determined locally, with the synced values layered on top for the values that only the server knows, being those driven by variables. Also show the value of a setting whose variable is erroring in red, as the shown value is then its statically configured fallback value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEB2eDBd8VaFgqeJRwaSyk
The values that are shown in the aspect properties tooltip of the part gui were fully determined by the values that the server syncs to the container. They are now also determined client-side, from the part state, which is known on both sides: * Properties that hold a variable in their setting slot are always shown, as the part state contains the variable slots of all aspects. The value that the variable produces is layered on top of this as soon as the server syncs it. * The errors of aspect setting variables are now stored inside the part state, just like the offset variable errors already were, so that the tooltip can render erroring values in red without any syncing. An update is sent to the client whenever such an error appears or disappears. Determining the shown values also no longer fails when the part disappears while its gui is open. Adds game tests for the full server-to-client path of these values: the server-side container broadcasting them, the value ids they are synced under being identical on both sides, the client-side container showing them, and the fallbacks when nothing was synced (yet). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEB2eDBd8VaFgqeJRwaSyk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes CyclopsMC/IntegratedTunnels#278
Aspect settings (aspect properties) could only hold static values before.
Every aspect setting now gets an optional variable slot in the aspect settings gui, just like the variable slots that the part offset gui got.
When a variable is present in that slot, its value overrides the statically configured value of that setting.
This is generic over all aspect properties, so add-ons such as IntegratedTunnels get it for free for their settings (channel, slot, exact match, ...).
Gui
</>buttons, only the slot of the setting that is currently being configured is visible; the gui informs the server which setting is active throughAbstractContainerMenu#clickMenuButton.Behaviour
aspectVariables_<aspect name>) inside the part state, so they are persisted with the part and dropped when the part is broken.PartStateAspectVariablesHandlerevaluates them on each part update tick and reloads a slot when its variable is invalidated, mirroringPartStateOffsetHandler.API
All additive, with defaults, so existing implementations keep working:
IAspect#getStaticProperties: the configured properties without variable-driven overrides.IAspect#getPropertiesnow returns the variable-driven values where present.IPartState#updateAspectVariables,#markAspectVariablesChanged,#markAspectPropertiesChanged,#getAspectVariableError,#getAspectVariableValue,#getAspectPropertiesVariableDrivenIPartType#onAspectVariablesChangedIPartState#loadInventoryNamednow bounds-checks against the target inventory size, so a shrunken property list can not cause an out-of-bounds crash.ContainerMultipartAspects#getModifiedAspectPropertyValuesbecame public.Tests
New
GameTestsAspectVariablescovers:./gradlew buildand./gradlew runGameTestServer(916 tests) pass.Note on an existing test helper
GameTestHelpersIntegratedDynamics#setAspectPropertymutated the aspect's shared default properties object whenever a part had no properties stored yet, which leaked configuration across game tests. It now clones instead. Two redstone pulse tests relied on that leak and set their pulse length on the wrong part/aspect; they now set it on the writer part itself.Generated by Claude Code