XFactHD / FramedBlocks

Fancy building blocks
GNU Lesser General Public License v3.0
68 stars 26 forks source link

[Mod Support]: Cannot get passed loading screen #460

Closed WiggleWizard closed 2 months ago

WiggleWizard commented 2 months ago

The mod to integrate with

Custom mod in development

Describe the feature

I can't seem to get FramedBlocks to load past the loading screen, it crashes with the error provided down below. The mod I am developing doesn't use any of these mixins. I am using Minecraft 1.20.1 with Forge 47.3.1.

[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /***********************************************************************************************************************************************************************/
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*                                                                            Invalid Mixin                                                                            */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     Action : APPLY                                                                                                                                                  */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*      Mixin : xfacthd.framedblocks.mixin.MixinMapItemSavedData                                                                                                       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     Config : framedblocks.mixin.json                                                                                                                                */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*      Phase : DEFAULT                                                                                                                                                */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException                                                                                      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     Critical injection failure: @ModifyExpressionValue annotation on framedblocks$checkVanillaFramedOrCustomFramed could not find any targets matching              */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     'Lnet/minecraft/world/level/saveddata/maps/MapItemSavedData;m_77918_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)V' in       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     net.minecraft.world.level.saveddata.maps.MapItemSavedData. Using refmap framedblocks.refmap.json [PREINJECT Applicator Phase ->                                 */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     framedblocks.mixin.json:MixinMapItemSavedData -> Prepare Injections ->  ->                                                                                      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     modifyExpressionValue$zzb000$framedblocks$checkVanillaFramedOrCustomFramed(ZLnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)Z    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     -> Parse]                                                                                                                                                       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @ModifyExpressionValue annotation on                    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     framedblocks$checkVanillaFramedOrCustomFramed could not find any targets matching                                                                               */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     'Lnet/minecraft/world/level/saveddata/maps/MapItemSavedData;m_77918_(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)V' in       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     net.minecraft.world.level.saveddata.maps.MapItemSavedData. Using refmap framedblocks.refmap.json [PREINJECT Applicator Phase ->                                 */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     framedblocks.mixin.json:MixinMapItemSavedData -> Prepare Injections ->  ->                                                                                      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     modifyExpressionValue$zzb000$framedblocks$checkVanillaFramedOrCustomFramed(ZLnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)Z    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*     -> Parse]                                                                                                                                                       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:656)                     */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.findTargets(InjectionInfo.java:587)                         */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.readAnnotation(InjectionInfo.java:330)                      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:316)                              */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:308)                              */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/MixinExtras@0.3.6/com.llamalad7.mixinextras.injector.MixinExtrasInjectionInfo.<init>(MixinExtrasInjectionInfo.java:10)                          */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/MixinExtras@0.3.6/com.llamalad7.mixinextras.injector.ModifyExpressionValueInjectionInfo.<init>(ModifyExpressionValueInjectionInfo.java:15)      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)                                                                    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)                                             */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)                                     */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)                                                                         */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)                                                                                   */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo$InjectorEntry.create(InjectionInfo.java:149)                */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.injection.struct.InjectionInfo.parse(InjectionInfo.java:708)                               */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTargetContext.prepareInjections(MixinTargetContext.java:1311)             */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.prepareInjections(MixinApplicatorStandard.java:1042)   */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:393)           */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325)                */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383)                          */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365)                    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)                            */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250)                     */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131)                    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156)          */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88)                      */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120)                                         */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50)             */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113)                                                           */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219)                                                     */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229)                                                          */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219)                                                               */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         cpw.mods.securejarhandler/cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135)                                                               */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)                                                                                             */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.createLevels(MinecraftServer.java:340)                                                    */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:311)                                                       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/minecraft@1.20.1/net.minecraft.client.server.IntegratedServer.initServer(IntegratedServer.java:66)                                              */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:652)                                                       */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         TRANSFORMER/minecraft@1.20.1/net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:251)                                                   */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /*         java.base/java.lang.Thread.run(Thread.java:840)                                                                                                             */
[23:58:01] [Server thread/FATAL] [MixinProcessor/]: /***********************************************************************************************************************************************************************/
XFactHD commented 2 months ago

If I remember correctly, you need to add the mixin gradle plugin to your build.gradle (https://github.com/XFactHD/FramedBlocks/blob/1.20/build.gradle#L7), otherwise mixins from mods you depend on don't get remapped to the mappings you use in your dev environment, which causes the error you encountered. Please let me know whether that fixes it.

WiggleWizard commented 2 months ago

Apologies. I haven't mentioned that I have my own mixins (using sponge). My own mixins don't tread on the feet of FramedBlocks from what I can see (I only have a single mixin on the player class). So I do have that entry in my grade build file.

My suspicion is that because I'm using a compiled FramedBlocks jar (from curse forge) and a decompiled and remapped Minecraft jar (which I assume is correct, when you're writing your own mod) that the mixins are struggling to map from FB?

Edit: Here's some more details about my build:

plugins {
    java
    idea
    id("net.minecraftforge.gradle") version "[6.0,6.2)"
    id("org.parchmentmc.librarian.forgegradle") version "1.2.0"
    id("org.spongepowered.mixin") version "0.7.38"
    id("com.github.johnrengelman.shadow") version "8.1.1"
}

runs {
register("client") {
            property("forge.enabledGameTestNamespaces", modId)
            jvmArgs("-ea", "-Xmx4G", "-Xms4G")

            property("mixin.env.remapRefMap", "true")
            property("mixin.env.refMapRemappingFile", "${layout.buildDirectory}/createSrgToMcp/output.srg")
        }
}

...

dependencies {
    annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
    implementation(fg.deobf("curse.maven:framedblocks-441647:5399211"))
}

...

mixin {
    add(sourceSets.main.get(), "${modId}.mixins.refmap.json")
    config("${modId}.mixins.json")

    val debugProperties = debug as DynamicProperties
    debugProperties.setProperty("verbose", true)
    debugProperties.setProperty("export", true)
}
WiggleWizard commented 2 months ago

Got it working.

I had this entry in my build Gradle file: property("mixin.env.refMapRemappingFile", "${layout.buildDirectory}/createSrgToMcp/output.srg"). I simply removed it and could get into the game and use FB correctly.

Awesome mod btw!