Elytra Trims

Elytra Trims

856k Downloads

[Bug]: Crash with Travelers Backpack

EmojiPati opened this issue ยท 14 comments

commented

Mod loader

Fabric

Minecraft version

1.21

Mod version

Latest

Affected mods

  • Elytra Trims
  • Extensions

Bug description

Elytra trims crash with travelers backpack.

Steps to reproduce

  1. Install Eytra trims and travelers backpack
  2. join server
    3.play normally
  3. press esc then insta crash

Relevant logs

No response

commented

This doesn't happen with just Elytra Trims and Traveler's Backpacks. Please provide the game log.

commented

I followed these steps and my game crashed.

join fabric server, press esc, press disconnect then insta crash

commented

I can second this. I've isolated that this error happens only when disconnecting from a server (that has the mod), removing Elytra Trims seems to work. If I had to guess, a mouseEvent is being called in the wrong place (server split-env instead of client split-env).
It's literally when you click the disconnect button.
crash-2024-07-31_23.17.03-client.txt

commented

I can third this. I've isolated the error to Elytra Trims & Traveler's Backpacks as well as Elytra Trims & Moving Elevators

commented

To add more information to this, this is reproduceable with the following mods:

Step 1) Install either set of the mods pictured below
Step 2) Install a Fabric 0.16.0 server and install the mods below
Step 3) Join the multiplayer server
Step 4) Disconnect

image
image

I cannot test further, as all these mods are dependencies of each other

commented

If you have the issue, please try this build and lmk if it works fine ๐Ÿ‘
fix67.zip

commented

Registries hold entries where each entry is identified by a resource location. When loading a save, each entry is additionally assigned an integer id. These integer ids are consecutive and stored in a list where the index of the entry in the list corresponds to the integer id of the entry (specifically, the MappedRegistry#byId field).
When iterating over a registry, it in turn iterates over the mentioned list.

Whenever a client joins a server, Fabric's RegistrySyncManager sends a packet containing the integer ids for all entries of all synched registries to the client. The client's registries then use these integer ids for their registry entries.

The FabricAPICompat class from Elytra Trims mixes into RegistrySyncManager and prevents any entries in any registries with the Elytra Trims namespace from being included in the registry sync from server to client when joining a server.

@WrapWithCondition(method = "createAndPopulateRegistryMap", at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/Object2IntMap;put(Ljava/lang/Object;I)I"))
private static boolean skipElytraRecipes(Object2IntMap<Object> instance, Object object, int value) {
return !(object instanceof Identifier id && id.getNamespace().equals(ETReference.MOD_ID));
}

This means when a client connects to a server, any entries from Elytra Trims are missing from the registry sync packet. As the integer ids are expected to be consecutive, if there happen to be any entries with a higher integer id than those of Elytra Trims', the aforementioned list will now contain indices with missing, i.e. null, elements.
This means when anything iterates over the registry, it will result in a null pointer exception.

When disconnecting from the server, Fabric's RegistrySyncManager happens to iterate over the registry to clear the integer ids, thus leading to the error.


I am not completely sure which synched registry Elytra Trims registers anything to, so not sure which registry specifically is causing the error here.

My guess for Moving Elevators/Traveller's Backpack causing the crash to occur is that there entries just happen to end up after those of Elytra Trims (due to some mod ordering somewhere perhaps), or that those mods were simply added to the world later on and thus their registry entries just happened to get higher ids.
As Moving Elevators was only updated recently, my guess would be the latter.
Anyways, I believe this issue is not caused by either Moving Elevators or Traveller's Backpack.

commented

It's for sure an elytra trims issue, but I'm yet to find a solution that adds server-side recipes which use the special serializer type (aka hardcoded)

commented

@kikugie It's having an error loading the data pack on the server and in the client.

[18:29:14] [main/WARN]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode
java.util.concurrent.ExecutionException: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_1863 failed
	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
	at net.minecraft.server.Main.main(Main.java:229) [server-intermediary.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480) [fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.16.0.jar:?]
	at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [fabric-server-mc.1.21-loader.0.16.0-launcher.1.0.1.jar:1.0.1]
Caused by: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_1863 failed
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:427) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119) ~[fabric-loader-0.16.0.jar:?]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
	at net.minecraft.class_5350.<init>(class_5350.java:50) ~[server-intermediary.jar:?]
	at net.minecraft.class_5350.method_58296(class_5350.java:83) ~[server-intermediary.jar:?]
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:653) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
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) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119) ~[fabric-loader-0.16.0.jar:?]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
	at net.minecraft.class_5350.<init>(class_5350.java:50) ~[server-intermediary.jar:?]
	at net.minecraft.class_5350.method_58296(class_5350.java:83) ~[server-intermediary.jar:?]
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:653) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Callback method addElytraRecipes(Ljava/util/Map;)Ljava/util/Map; in elytratrims-common.mixins.json:RecipeManagerMixin from mod elytratrims failed injection check, (0/1) succeeded. Scanned 0 target(s). Using refmap elytratrims-fabric-1.21-fabric-refmap.json
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:531) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1490) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:752) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:330) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:246) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:437) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:418) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) ~[sponge-mixin-0.15.0+mixin.0.8.7.jar:0.15.0+mixin.0.8.7]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218) ~[fabric-loader-0.16.0.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119) ~[fabric-loader-0.16.0.jar:?]
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
	at net.minecraft.class_5350.<init>(class_5350.java:50) ~[server-intermediary.jar:?]
	at net.minecraft.class_5350.method_58296(class_5350.java:83) ~[server-intermediary.jar:?]
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture.postFire(CompletableFuture.java:614) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:653) ~[?:?]
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]

java.util.concurrent.ExecutionException: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_1863 failed
commented

I'm also having this issue, I have elytra trims installed and crash immidately after leaving server.

commented

From my testing, this should be fixed. Here's the builds with the fix - if it breaks please lmk:
fix67_2.zip

commented

The file linked above successfully fixes the issue.

commented

Resolved in 3.5.0