fix: reading a book no longer freezes a moving train - #597
Open
bh679 wants to merge 2 commits into
Open
Conversation
…train Vanilla BookViewScreen inherits Screen.isPauseScreen()=true and doesn't override it, so reading a written book pauses singleplayer and triggers a full autosave. On a moving Sable train that autosave shuffles sub-levels through holding chunks and the resume fails to restore them, vanishing the carriages around the player until a world reload. Add an isPauseScreen()=false override to BookViewScreen via a client mixin (an additive method merge, not @Inject — BookViewScreen doesn't declare the method, so an @Inject would fail to resolve at apply-time). Reading a book no longer pauses/autosaves a run mid-ride; the train keeps moving. Scope: book screen only; ESC-menu / advancement-popup pauses are handled in a separate session. Bumps mod_version 0.367.0 -> 0.368.0 (MINOR; main is at PATCH=0 with the cascade paused, so version-bump.yml skips its merge bump) and logs the player-facing changelog entry. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
Summary
Reading a written book in singleplayer on the moving Sable train made the carriage group under the player's feet (plus neighbours) vanish ~1 s later, returning only on a world reload.
Root cause: DT's books open the vanilla
BookViewScreen, which inheritsScreen.isPauseScreen()(defaults totrue) without overriding it (confirmed viajavap). Opening a book pauses singleplayer → triggers a full autosave → Sable'ssaveAll()shuffles the train's sub-levels through holding chunks, and the resume (book close) fails to restore the sub-levels around the player (Attempted to snatch sub-level … wasn't present in the holding chunk/Received a sub-level movement packet for a non-existent sub-level), vanishing the carriages.This adds the
isPauseScreen() → falseoverride Mojang omitted, via a client mixin, so reading a book no longer pauses/autosaves a run mid-ride — the train keeps moving while you read.Implemented as an additive method merge, not
@Inject: sinceBookViewScreendoesn't declareisPauseScreen()(it's inherited fromScreen), an@InjecttargetingBookViewScreenwould fail to resolve at apply-time and crash on load.Scope / trade-off
Mod impact
One new client mixin. No new deps, no MC/NeoForge/Sable bump, no new blocks/items/entities, no world-gen or networking changes.
Changes
src/main/java/games/brennan/dungeontrain/mixin/client/BookViewScreenNoPauseMixin.java(new)src/main/resources/dungeontrain.mixins.json(registerclient.BookViewScreenNoPauseMixin)gradle.propertiesmod_version0.367.0 → 0.368.0.github/release-notes/changelog.json(player-facingfixentry)Test plan
./gradlew build— pass;build/libs/dungeontrain-0.368.0.jar(8.3 MB)./gradlew runClient— launches clean; log confirms the mixin applies intoBookViewScreenwith no apply errorSaving and pausing game…on open, no Sable snatch/holding-chunk errors on close, no carriages vanish, train keeps moving🤖 Generated with Claude Code