OptiFabric

OptiFabric

9M Downloads

Found a fix, code needs updating - Crash on startup with Charm 4.1.2

Andy1x opened this issue ยท 6 comments

commented

Game crashes on startup with the exit code 1 when using Optifine version 1.19_HD_U_H8_pre4 and Optifabric version 1.13.4.
I tested it by removing all mods one by one other than Optifine and Optifabric, and the game only crashed with Charm 4.1.2.

I've attached the startup log

commented

Same. MC 1.18.2. Optifabric version 1.13.5/1.13.4/1.13.0 + Optifine version 1.18_HD_U_H7/1.18_HD_U_H6 + Charm version 4.1.2/4.1.1
latest.log

commented

Appears to be a problem with BlockEntityRenderDispatcherMixin. If anyone knows if I can disable/blacklist it or smth I'd appreciate it

commented

Update: Trying different things, the error is with the mixin that tries to open the mixin in the folder charm/mixin/storage_labels called 'CallStorageLabelsRenderMixin'. There is no storage_labels file in the new Charm versions as it was removed in 4.0.0. Still looking into solutions bc I don't know code lmao but hope this helps the dev

Edit: Seems that the SpriteAtlasTexture Mixin is also looking for a file that doesn't exist called StitchTextureCallbackMixin in charm/mixin/callback

Update 2: Issue seems to be with the StitchTextureMixin file during hookStitch injection. Here's the relevant code from the log: Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: LVT in net/minecraft/class_1059::method_18163(Lnet/minecraft/class_3300;Ljava/util/stream/Stream;Lnet/minecraft/class_3695;I)Lnet/minecraft/class_1059$class_4007; has incompatible changes at opcode 150 in callback charm.mixins.json:event.StitchTextureMixin from mod charm->@Inject::hookStitch(Lnet/minecraft/class_3300;Ljava/util/stream/Stream;Lnet/minecraft/class_3695;ILorg/spongepowered/asm/mixin/injection/callback/CallbackInfoReturnable;Ljava/util/Set;)V. Expected: [Ljava/util/Set;] Found: [I] Available: [I, Ljava/util/Set;, Ljava/util/HashSet;, I, Lnet/minecraft/class_1055;, I, I, I]

Unsure why this happens only when using optifabric, but as I have removed the relevant compat fix Mixin files from Optifabric, that might be the issue. Possibly the SpriteAtlasTextureMixin provided a fix for it, but the codepath was wrong as the file was moved and name changed.

Old filepath: svenhjol/charm/mixin/callback/StitchTextureCallbackMixin
New filepath: svenhjol/charm/api/event/StitchTextureCallback OR svenhjol/charm/mixin/event/StitchTextureMixin

commented

Last update as I have resolved the issue (woo!). I have removed the Optifine BlockEntityRenderDispatcher Mixin and the reference in to it compat.charm.mixin, and changed the filepath in the SpriteAtlasTextureMixin to the new location of StitchTextureMixin (svenhjol/charm/mixin/event/StitchTextureMixin), and the game is no longer crashing!
I created a pull request with steps as to what I did, not sure if it has actually gone through but it's 2am so I might rewrite it here tomorrow. For now, here are the files I edited. Probably will have to be renamed and new config written into OptifabricSetup.
Optifabric Charm 4+ fix.zip

@bons66 if you wanted to do this, it should work!

Steps

  • delete BlockEntityRenderDispatcherMixin.java - I assume the dev will make a new folder to put this Mixin and the SpriteAtlasTextureMixin in
  • Edit optifabric.compat.charm.mixins.json and remove "BlockEntityRenderDispatcherMixin" from the mixins list (Line 6) - again I assume the dev will save the new .json under a new name
  • Edit the filepath in SpriteAtlatTextureMixin.json on line 23 to "svenhjol/charm/mixin/event/StitchTextureMixin"
  • Dev only: Add new .json config in OptifabricSetup.java. The charm configs start on line 305 and end on line 325. I don't know Java (literally learned how to edit files yesterday purely for this fix) but the new config might look something like this: } else if (isPresent("charm", ">=3.0 <4.0")) { Mixins.addConfiguration("optifabric.compat.[CharmNew].json");
commented

I don't know where should I edit this. Can you send edited file pls?

commented

I don't know where should I edit this. Can you send edited file pls?

I don't want to distribute it publicly but you can pop me a message on discord or twitter, they're in my bio