Closed zml2008 closed 2 months ago
Thanks for this, I have changed the structure of how initialisers are handled to pull functionality out of the applicator and into the target so that information can be shared with CTOR_HEAD
, but it's likely this has introduced this issue. I'll have a look into it. This was the entire point of releasing a snaphot first.
I'm afraid I've been a bit checked out of things for a while, but just poking around the the 0.8.6 snapshots on Sponge (see SpongePowered/Sponge#3937), I'm getting a new runtime failure based on the same Mixins and target classes. Looking at the exported transformed class file, the initializer merging isn't matching what I'd expect.
The Mixin in question
Stacktrace
``` [19:50:01] [main/ERROR]: Failed to invoke main class org.spongepowered.vanilla.applaunch.Main due to an error: Caused by: java.lang.ExceptionInInitializerError at net.minecraft.server.Bootstrap.bootStrap(Bootstrap.java:50) at org.spongepowered.vanilla.launch.IntegrationTestLaunch.performIntegrationTests(IntegrationTestLaunch.java:70) at org.spongepowered.vanilla.launch.VanillaBootstrap.perform(VanillaBootstrap.java:64) at org.spongepowered.vanilla.launch.IntegrationTestLaunch.performBootstrap(IntegrationTestLaunch.java:63) at org.spongepowered.vanilla.launch.VanillaLaunch.launchPlatform(VanillaLaunch.java:118) at org.spongepowered.vanilla.launch.IntegrationTestLaunch.launch(IntegrationTestLaunch.java:49) ... 23 more Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Map.put(Object, Object)" because "this.impl$entries" is null at net.minecraft.core.MappedRegistry.bridge$register(MappedRegistry.java:1100) at net.minecraft.core.MappedRegistry.handler$zef000$impl$cacheRegistryEntry(MappedRegistry.java:1089) at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:180) at net.minecraft.core.MappedRegistry.register(MappedRegistry.java:185) at net.minecraft.core.registries.BuiltInRegistries.internalRegister(BuiltInRegistries.java:221) at net.minecraft.core.registries.BuiltInRegistries.registerDefaultedWithIntrusiveHolders(BuiltInRegistries.java:213) at net.minecraft.core.registries.BuiltInRegistries.registerDefaultedWithIntrusiveHolders(BuiltInRegistries.java:201) at net.minecraft.core.registries.BuiltInRegistries.impl$entries
is a field added by the Mixin with an initializer, so I wouldn't expect it to be null here. Looking at the dump, I get the following decompile output (comments mine) -- it seems the jump checking$$2
is jumping to right after those initializers:Method bytecode
```java // access flags 0x1 // signature (Lnet/minecraft/resources/ResourceKey<+Lnet/minecraft/core/Registry;>;Lcom/mojang/serialization/Lifecycle;Z)V // declaration: void