Skip to content

Fix TARDIS client sound lifecycle - #2168

Open
Peter1169 wants to merge 4 commits into
amblelabs:mainfrom
Peter1169:feat/tardis-reliability
Open

Peter1169 wants to merge 4 commits into
amblelabs:mainfrom
Peter1169:feat/tardis-reliability

Conversation

@Peter1169

Copy link
Copy Markdown
Contributor

About the PR

This makes the individual TARDIS client sound handlers stop and reset their own sounds when the client context they depend on is no longer valid.

  • The current client TARDIS reference is cleared when changing to a world without a TARDIS and validated against the active client world before it is returned.
  • Flight music stops itself when there is no longer a current TARDIS.
  • The interior hum handler owns its complete reset and reinitialization lifecycle.
  • The sonic sound handler owns its world-change cleanup.

This intentionally does not add a central sound shutdown call to ClientTardisManager.

Why / Balance

This has no gameplay balance impact. It prevents TARDIS-specific sounds from continuing after leaving an interior, changing worlds, dying, disconnecting or otherwise losing the client-side TARDIS context that created them.

Keeping cleanup inside each handler also means future sound handlers can define the state they own instead of depending on an unrelated TARDIS data manager to maintain a complete global list.

Technical details

  • ClientTardisUtil#getCurrentTardis now verifies that its reference matches the TARDIS UUID attached to the active client world.
  • World changes without a TARDIS clear the stale reference instead of leaving it available to later sound ticks.
  • ClientFlightMusicHandler, ClientHumHandler and SonicSoundHandler perform their own context checks and cleanup.
  • Hum reset stops active instances, clears the selected hum and marks the handler for safe reinitialization when a valid TARDIS becomes available again.
  • The changes have passed Spotless, datagen and the complete Gradle build.

Media

N/A

Requirements

Breaking changes

N/A

Changelog
🆑

  • fix: TARDIS hums, flight music and sonic sounds no longer continue after their client context is gone.

@github-actions github-actions Bot added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Jul 31, 2026
@Peter1169
Peter1169 marked this pull request as ready for review July 31, 2026 19:31
@Peter1169
Peter1169 requested a review from a team as a code owner July 31, 2026 19:31
@github-actions github-actions Bot added the S: Needs Review Status: Requires additional reviews before being fully accepted. label Jul 31, 2026
@Peter1169 Peter1169 mentioned this pull request Jul 31, 2026
2 tasks

@drtheodor drtheodor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGE_WORLD is already working properly, there's no need to re-query the current tardis from the cache each time (not to mention that doing string -> uuid is slightly expensive.

this method gets called in rendering a lot, and I don't see a reason to why it should re-query every call

Comment thread src/main/java/dev/amble/ait/client/util/ClientTardisUtil.java Outdated
Comment thread src/main/java/dev/amble/ait/client/util/ClientTardisUtil.java Outdated
@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-99 lines. label Aug 27, 2026
@GSMPBot
GSMPBot requested review from Loqor and duzos August 27, 2026 17:19
@Peter1169
Peter1169 requested a review from drtheodor August 28, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S: Needs Review Status: Requires additional reviews before being fully accepted. S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants