VideoGameSmash12 / HotbarsPlus

Get more use out of your saved hotbars!
MIT License
10 stars 2 forks source link

Crashes on startup with 1.20.3 #33

Open VideoGameSmash12 opened 12 months ago

VideoGameSmash12 commented 12 months ago

sigh

java.lang.RuntimeException: Could not execute entrypoint stage 'client' due to errors, provided by 'hotbarsplus'!
    at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388)
    at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386)
    at net.fabricmc.loader.impl.game.minecraft.Hooks.startClient(Hooks.java:53)
    at net.minecraft.class_310.<init>(class_310.java:487)
    at net.minecraft.client.main.Main.main(Main.java:223)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:87)
    at org.prismlauncher.EntryPoint.listen(EntryPoint.java:130)
    at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
    Suppressed: java.lang.NoClassDefFoundError: Could not initialize class me.videogamesm12.hotbarsplus.core.HBPCore
        at me.videogamesm12.hotbarsplus.v1_20.HotbarsPlus.onInitializeClient(HotbarsPlus.java:42)
        at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384)
        ... 9 more
    Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.RuntimeException: Mixin transformation of net.minecraft.class_302 failed [in thread "Render thread"]
        at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:427)
        at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
        at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
        at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at me.videogamesm12.hotbarsplus.core.HBPCore.<clinit>(HBPCore.java:50)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:467)
        at net.fabricmc.loader.impl.util.DefaultLanguageAdapter.create(DefaultLanguageAdapter.java:50)
        at net.fabricmc.loader.impl.entrypoint.EntrypointStorage$NewEntry.getOrCreate(EntrypointStorage.java:117)
        at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:53)
        ... 10 more
Caused by: java.lang.ExceptionInInitializerError
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:467)
    at net.fabricmc.loader.impl.util.DefaultLanguageAdapter.create(DefaultLanguageAdapter.java:50)
    at net.fabricmc.loader.impl.entrypoint.EntrypointStorage$NewEntry.getOrCreate(EntrypointStorage.java:117)
    at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:53)
    at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384)
    ... 9 more
Caused by: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_302 failed
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:427)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    at me.videogamesm12.hotbarsplus.core.HBPCore.<clinit>(HBPCore.java:50)
    ... 15 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422)
    ... 20 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [hotbarsplus.mixin.json:HotbarStorageMixin from mod hotbarsplus] from phase [DEFAULT] in config [hotbarsplus.mixin.json] FAILED during APPLY
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:638)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinApplyError(MixinProcessor.java:589)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:379)
    ... 23 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Invalid descriptor on hotbarsplus.mixin.json:HotbarStorageMixin from mod hotbarsplus->@Inject::inject(Ljava/io/File;Lcom/mojang/datafixers/DataFixer;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V! Expected (Ljava/nio/file/Path;Lcom/mojang/datafixers/DataFixer;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V but found (Ljava/io/File;Lcom/mojang/datafixers/DataFixer;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V [INJECT Applicator Phase -> hotbarsplus.mixin.json:HotbarStorageMixin from mod hotbarsplus -> Apply Injections ->  -> Inject -> hotbarsplus.mixin.json:HotbarStorageMixin from mod hotbarsplus->@Inject::inject(Ljava/io/File;Lcom/mojang/datafixers/DataFixer;Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V]
    at org.spongepowered.asm.mixin.injection.callback.CallbackInjector.inject(CallbackInjector.java:567)
    at org.spongepowered.asm.mixin.injection.callback.CallbackInjector.inject(CallbackInjector.java:497)
    at org.spongepowered.asm.mixin.injection.code.Injector.inject(Injector.java:276)
    at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.inject(InjectionInfo.java:445)
    at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1377)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1062)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:402)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:327)
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421)
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
    ... 23 more
VideoGameSmash12 commented 12 months ago

This issue is caused by 1.20.3 changing how instances of HotbarStorage are created. Instead of using java.io.File, they changed it so that it uses java.nio.file.Path instead.

Unfortunately, Hotbars+ relies heavily on the use of replacing instances of java.io.File with its own, and attempting to support 1.20.3 by replacing it with Path would end up breaking backwards compatibility with versions 1.14 to 1.20.2 in the current way the project is set up. This leaves me at a crossroad where I need to either jankily unbork the way things are setup or completely restructure the project to reduce the need for boilerplate code.

I'll look into trying to get the former to work just for the sake of time.