CIT Resewn

CIT Resewn

14M Downloads

Crash on macOS due to incorrect attempt to load .DS_Store as config

ViRb3 opened this issue · 2 comments

commented

Got this report from a user trying to play Valhelsia Enhanced Vanilla - 1.18 on a M1 Mac: https://pastebin.com/EMUp0qvx

It appears that CITResewn attempts to load .DS_Store as a config, which is instead a file automatically generated by macOS to store folder viewing preferences. Obviously, the format is unsupported, and results in a crash.

EDIT: Turns out the assets are actually injected into CITResewn through KubeJS. I'm not sure whether this bug should be filed at this project or KubeJS. Either way, to reproduce, create a file .DS_Store like this: ...minecraft/kubejs/assets/.DS_Store.

Whichever project ends up implementing a fix, it would likely need to skip unix-style hidden files (starting with dot), or at least skip .DS_Store.

The relevant error is here:

[17:36:23] [Render thread/INFO]: Caught error loading resourcepacks, removing all selected resourcepacks
java.util.concurrent.CompletionException: net.minecraft.class_151: Non [a-z0-9_.-] character in namespace of location: .DS_Store:citresewn/cit.properties
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?]
Caused by: net.minecraft.class_151: Non [a-z0-9_.-] character in namespace of location: .DS_Store:citresewn/cit.properties
at net.minecraft.class_2960.(class_2960.java:38) ~[client-intermediary.jar:?]
at net.minecraft.class_2960.(class_2960.java:50) ~[client-intermediary.jar:?]
at shcm.shsupercm.fabric.citresewn.pack.CITParser.parse(CITParser.java:63) ~[CITResewn-0.8.1-1.18.jar:?]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?]
at shcm.shsupercm.fabric.citresewn.pack.CITParser.parseCITs(CITParser.java:43) ~[CITResewn-0.8.1-1.18.jar:?]
at net.minecraft.class_1088.handler$znj000$initCITs(class_1088.java:626) ~[client-intermediary.jar:?]
at net.minecraft.class_1088.method_4727(class_1088.java:465) ~[client-intermediary.jar:?]
at net.minecraft.class_1088.(class_1088.java:193) ~[client-intermediary.jar:?]
at net.minecraft.class_1092.method_18178(class_1092.java:52) ~[client-intermediary.jar:?]
at net.minecraft.class_1092.method_18789(class_1092.java:19) ~[client-intermediary.jar:?]
at net.minecraft.class_4080.method_18791(class_4080.java:11) ~[client-intermediary.jar:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
... 6 more

commented

I'm pretty sure this'll fix it. Will be out with v0.8.2

commented

The error says it tried to use .DS_Store as a namespace(.DS_Store: ...). I offloaded the namespaces fetching to vanilla code which apparently doesnt check that namespaces are valid.

The bug is on my end, not on Kube's, I just need to manually ignore malformatted namespaces in CITParser.java@61