Devan-Kerman / ARRP

A fabric api for creating resources and assets at runtime
Mozilla Public License 2.0
104 stars 27 forks source link

Incompatibility with 1.18.2 #57

Closed SolidBlock-cn closed 2 years ago

SolidBlock-cn commented 2 years ago
[13:55:58] [Render thread/ERROR] (FabricLoader/Mixin) Mixin apply for mod advanced_runtime_resource_pack failed arrp.mixins.json:ReloadableResourceManagerImplMixin -> net.minecraft.resource.ReloadableResourceManagerImpl: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException @Shadow method method_14475 in arrp.mixins.json:ReloadableResourceManagerImplMixin was not located in the target class net.minecraft.resource.ReloadableResourceManagerImpl. Using refmap arrp-refmap.json
 org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: @Shadow method method_14475 in arrp.mixins.json:ReloadableResourceManagerImplMixin was not located in the target class net.minecraft.resource.ReloadableResourceManagerImpl. Using refmap arrp-refmap.json
    at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachSpecialMethod(MixinPreProcessorStandard.java:436) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachShadowMethod(MixinPreProcessorStandard.java:412) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachMethods(MixinPreProcessorStandard.java:340) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:299) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:277) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1289) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:292) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403) ~[sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) [sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) [sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) [sponge-mixin-0.11.2+mixin.0.8.5.jar:0.11.2+mixin.0.8.5]
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:247) [fabric-loader-0.13.3.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:150) [fabric-loader-0.13.3.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:155) [fabric-loader-0.13.3.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:520) [?:?]
    at net.minecraft.client.MinecraftClient.<init>(MinecraftClient.java:504) [minecraft-project-@-merged-named.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:197) [minecraft-project-@-merged-named.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:416) [fabric-loader-0.13.3.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) [fabric-loader-0.13.3.jar:?]
    at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28) [fabric-loader-0.13.3.jar:?]
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Devan-Kerman commented 2 years ago

looking into it now

EthanRDoesMC commented 2 years ago

I get a similar crash on Fabric API 0.47.8, but notably on 1.18.1:

A mod crashed on startup!
net.fabricmc.loader.impl.FormattedException: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'advanced_runtime_resource_pack'!
    at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:159)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'advanced_runtime_resource_pack'!
    at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51)
    at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
    at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49)
    at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35)
    at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:157)
    ... 10 more
Caused by: net.fabricmc.loader.api.EntrypointException: Exception while loading entries for entrypoint 'preLaunch' provided by 'advanced_runtime_resource_pack'
    at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:56)
    at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47)
    ... 12 more
Caused by: java.lang.RuntimeException: Mixin transformation of net.devtech.arrp.ARRP failed
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:252)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:150)
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:155)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    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)
    ... 13 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [fabric-registry-sync-v0.mixins.json:MixinDynamicRegistryManager] from phase [DEFAULT] in config [fabric-registry-sync-v0.mixins.json] from mod [fabric-registry-sync-v0] FAILED during PREPARE
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:638)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinPrepareError(MixinProcessor.java:585)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:543)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:462)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290)
    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:247)
    ... 21 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: @Mixin target type mismatch: net.minecraft.class_5455 is not an interface in org.spongepowered.asm.mixin.transformer.MixinInfo$SubType$Interface@50a13c2f
    at org.spongepowered.asm.mixin.transformer.MixinInfo$SubType.validateTarget(MixinInfo.java:553)
    at org.spongepowered.asm.mixin.transformer.MixinInfo.getTargetClass(MixinInfo.java:1027)
    at org.spongepowered.asm.mixin.transformer.MixinInfo.readTargetClasses(MixinInfo.java:1008)
    at org.spongepowered.asm.mixin.transformer.MixinInfo.parseTargets(MixinInfo.java:896)
    at org.spongepowered.asm.mixin.transformer.MixinConfig.prepareMixins(MixinConfig.java:869)
    at org.spongepowered.asm.mixin.transformer.MixinConfig.prepare(MixinConfig.java:777)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:540)
    ... 27 more

edit: want to add that this only happened once I updated Fabric API from 0.45.2

SolidBlock-cn commented 2 years ago

I get a similar crash on Fabric API 0.47.8, but notably on 1.18.1:

A mod crashed on startup!
net.fabricmc.loader.impl.FormattedException: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'advanced_runtime_resource_pack'!
  at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:159)
  at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:71)
  at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
  at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
  at org.multimc.EntryPoint.listen(EntryPoint.java:143)
  at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.RuntimeException: Could not execute entrypoint stage 'preLaunch' due to errors, provided by 'advanced_runtime_resource_pack'!
  at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51)
  at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33)
  at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49)
  at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35)
  at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:157)
  ... 10 more
Caused by: net.fabricmc.loader.api.EntrypointException: Exception while loading entries for entrypoint 'preLaunch' provided by 'advanced_runtime_resource_pack'
  at net.fabricmc.loader.impl.entrypoint.EntrypointContainerImpl.getEntrypoint(EntrypointContainerImpl.java:56)
  at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47)
  ... 12 more
Caused by: java.lang.RuntimeException: Mixin transformation of net.devtech.arrp.ARRP failed
  at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:252)
  at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:150)
  at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:155)
  at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
  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)
  ... 13 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [fabric-registry-sync-v0.mixins.json:MixinDynamicRegistryManager] from phase [DEFAULT] in config [fabric-registry-sync-v0.mixins.json] from mod [fabric-registry-sync-v0] FAILED during PREPARE
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:638)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinPrepareError(MixinProcessor.java:585)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:543)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:462)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290)
  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:247)
  ... 21 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: @Mixin target type mismatch: net.minecraft.class_5455 is not an interface in org.spongepowered.asm.mixin.transformer.MixinInfo$SubType$Interface@50a13c2f
  at org.spongepowered.asm.mixin.transformer.MixinInfo$SubType.validateTarget(MixinInfo.java:553)
  at org.spongepowered.asm.mixin.transformer.MixinInfo.getTargetClass(MixinInfo.java:1027)
  at org.spongepowered.asm.mixin.transformer.MixinInfo.readTargetClasses(MixinInfo.java:1008)
  at org.spongepowered.asm.mixin.transformer.MixinInfo.parseTargets(MixinInfo.java:896)
  at org.spongepowered.asm.mixin.transformer.MixinConfig.prepareMixins(MixinConfig.java:869)
  at org.spongepowered.asm.mixin.transformer.MixinConfig.prepare(MixinConfig.java:777)
  at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:540)
  ... 27 more

edit: want to add that this only happened once I updated Fabric API from 0.45.2

I have tested and found that, ARRP is actually perfectly compatible with 1.18.1. However, some mods have nested API that is only compatible with 1.18.2, for example Mod Menu. I think nesting APIs in mod files is a bad habit.

SolidBlock-cn commented 2 years ago

looking into it now

I have a suggestion:

@Mixin (LifecycledResourceManagerImpl.class)
public abstract class ReloadableResourceManagerImplMixin {
  private static final Logger LOGGER = LoggerFactory.getLogger(ReloadableResourceManagerImpl.class);

    @ModifyVariable(method = "<init>",
            at = @At (value = "HEAD"),index = 2, argsOnly = true)
    private static List registerARRPs(List value) {
        LOGGER.info("ARRP register - before vanilla");
        List<ResourcePack> pack = new ArrayList<>();
        RRPCallback.BEFORE_VANILLA.invoker().insert(pack);
    pack.addAll(value);
    LOGGER.info("ARRP register - after vanilla");
    List<ResourcePack> pack2 = new ArrayList<>();
    RRPCallback.AFTER_VANILLA.invoker().insert(pack2);
    pack.addAll(pack2);
    return pack;
  }
}
Devan-Kerman commented 2 years ago

I didn't even look at yours but I came to the same conclusion, though I still mixed into ReloadableResourceManagerImpl

Devan-Kerman commented 2 years ago

this is fixed and a new release will come out shortly once I fix a few other bugs

SolidBlock-cn commented 2 years ago

May be you can release newer versions in this GitHub