Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QuiltBasePath.java: update URI conversion #462

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

StartsMercury
Copy link
Contributor

No description provided.

@ix0rai ix0rai added the enhancement new feature or improvement label Dec 26, 2024
@AlexIIL
Copy link
Contributor

AlexIIL commented Jan 15, 2025

Does this fix a bug or something else? I'm mostly wondering what to test for with this, otherwise this looks reasonable.

@StartsMercury
Copy link
Contributor Author

StartsMercury commented Jan 16, 2025

Does this fix a bug or something else? I'm mostly wondering what to test for with this, otherwise this looks reasonable.

I was contributing to updating cosmic-quilt, Quilt game provider for Cosmic Reach, and it was crashing when loading music assets, contained in the game JAR, that had spaces in the file name. I recall that it was crashing at creting the path URI, I'll have to find my original logs or have to reproduce the crash. Reproduce:

Reproduced Crash Logs
java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in path at index 52: quilt.zfs://cosmicreach-0.3.12.i0:0/base/music/Fluff (Stewart Keller).json
    at org.quiltmc.loader.impl.filesystem.QuiltBasePath.toUri(QuiltBasePath.java:561)
    at org.quiltmc.loader.impl.util.UrlUtil.asUrl(UrlUtil.java:80)
    at org.quiltmc.loader.impl.launch.knot.KnotClassLoader.findResource(KnotClassLoader.java:124)
    at org.quiltmc.loader.impl.launch.knot.KnotClassLoader.getResource(KnotClassLoader.java:108)
    at org.quiltmc.loader.impl.launch.knot.KnotClassLoader.getResource(KnotClassLoader.java:101)
    at java.base/java.lang.Class.getResource(Class.java:3115)
    at com.badlogic.gdx.files.FileHandle.exists(FileHandle.java:560)
    at finalforeach.cosmicreach.GameAssetLoader.loadAsset(GameAssetLoader.java:144)
    at finalforeach.cosmicreach.GameAssetLoader.forEachAsset(GameAssetLoader.java:211)
    at finalforeach.cosmicreach.GameAssetLoader.forEachAsset(GameAssetLoader.java:156)
    at finalforeach.cosmicreach.audio.GameMusicManager.setup(GameMusicManager.java:149)
    at finalforeach.cosmicreach.ClientSingletons.create(ClientSingletons.java:69)
    at finalforeach.cosmicreach.BlockGame.create(BlockGame.java:101)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.initializeListener(Lwjgl3Window.java:416)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:366)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:193)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
    at finalforeach.cosmicreach.lwjgl3.Lwjgl3Launcher.createApplication(Lwjgl3Launcher.java:103)
    at finalforeach.cosmicreach.lwjgl3.Lwjgl3Launcher.main(Lwjgl3Launcher.java:91)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at dev.crmodders.cosmicquilt.loader.CosmicGameProvider.launch(CosmicGameProvider.java:442)
    at dev.crmodders.cosmicquilt.loader.knot.Knot.launch(Knot.java:23)
    at dev.crmodders.cosmicquilt.loader.knot.KnotClient.main(KnotClient.java:7)
Caused by: java.net.URISyntaxException: Illegal character in path at index 52: quilt.zfs://cosmicreach-0.3.12.i0:0/base/music/Fluff (Stewart Keller).json
    at java.base/java.net.URI$Parser.fail(URI.java:2995)
    at java.base/java.net.URI$Parser.checkChars(URI.java:3166)
    at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3248)
    at java.base/java.net.URI$Parser.parse(URI.java:3196)
    at java.base/java.net.URI.<init>(URI.java:645)
    at org.quiltmc.loader.impl.filesystem.QuiltBasePath.toUri(QuiltBasePath.java:559)
    ... 23 more

@AlexIIL
Copy link
Contributor

AlexIIL commented Jan 17, 2025

Thanks for the clarification!

@AlexIIL AlexIIL merged commit ca8a0a1 into QuiltMC:develop Jan 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants