Skip to content

Conversation

@hongkevin233
Copy link

@hongkevin233 hongkevin233 commented Sep 27, 2025

This PR resolves two critical issues in Continuity: unintended MTS pack resource loading and NPE crashes from invalid input streams—with targeted changes across 3 core classes (backward-compatible for non-MTS packs).

Key Changes

  1. ResourceRedirectHandler.java

    • Add MTS validation via pack.mcmeta (whitelists valid paths via mts.validResources`).
    • Restrict redirection to mts/continuity namespaces; validate post-redirect paths.
  2. CtmPropertiesLoader.java

    • Whitelist MTS CTMs via pack.mcmeta(loads valid paths from mts.validCtmPaths).
    • Check for null input streams to fix NPEs; validate CTM-dependent textures.
    • Enhance logs with pack/path details for troubleshooting.
  3. AtlasLoaderMixin.java

    • Add null checks for emissive texture input streams (fixes crash source).
    • Validate MTS legitimacy for base/emissive textures; secure thread context handling.

MTS Pack Requirement
Add mts field to pack.mcmeta (example) for validation:
{
"mts": {
"validResources": ["mts:textures/block/stone.png"],
"validCtmPaths": ["optifine/ctm/mts_stone.ctm.properties"]
}
}

Fixed Issues

  • ✅ Stops loading unlisted MTS resources/CTMs.
  • ✅ Eliminates NPE crashes from invalid streams.
  • ✅ Improves MTS compatibility without breaking non-MTS packs.

fixed the bug that cant accept “null” from resource manerger, and this bug used to cause crash
fixed the bug that load resource from null ( optimized the logic for detecting whether a resource pack is an MTS resource pack, reducing false positives.)
Added MTS resource pack validation through pack.mcmeta parsing
2. Implemented checks for null input streams to prevent NPE crashes
3. Added namespace filtering to reduce unnecessary resource loading
4. Enhanced error logging with specific pack and path information
5. Added validation for dependent textures in CTM configurations
@PepperCode1
Copy link
Owner

Compatibility was fixed on Immersive Vehicle's side about 2 weeks ago in DonBruce64/MinecraftTransportSimulator@1ffdd58, but a release was not made with that fix yet. These changes are not necessary.

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