FlashyReese/sodium-extra-fabric

Sodium Extra 0.4.24 and above seem to break the behavior of slight-gui-modifications.

LittleCircleOO opened this issue · 1 comments

Make sure you are not opening a duplicate.

Minecraft version.

1.20.1

Sodium Extra version.

0.4.24 and above

Sodium version.

0.4.10

What happened?

When I updated Sodium Extra to version 0.4.24 and above, the following error message was repeatedly scrubbed from the logs, which resulted in disk space being quickly overwritten with garbage messages. NOT reproduced in versions 0.4.23 and below.

[Render thread/INFO]: [STDERR]: java.lang.IllegalStateException
[Render thread/INFO]: [STDERR]: 	at me.shedaniel.slightguimodifications.SlightGuiModifications.setAlpha(SlightGuiModifications.java:86)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_332.handler$jfd000$slight-gui-modifications$innerBlit(class_332.java:5777)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_332.method_25295(class_332.java)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_332.method_25298(class_332.java:309)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_485.method_18643(class_485.java:96)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_485.method_2477(class_485.java:57)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_485.method_25394(class_485.java:28)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_490.method_25394(class_490.java:88)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_437.method_47413(class_437.java:110)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_757.method_3192(class_757.java:945)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_310.method_1523(class_310.java:1219)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.class_310.method_1514(class_310.java:802)
[Render thread/INFO]: [STDERR]: 	at net.minecraft.client.main.Main.main(Main.java:250)
[Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468)
[Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
[Render thread/INFO]: [STDERR]: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Render thread/INFO]: [STDERR]: 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[Render thread/INFO]: [STDERR]: 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[Render thread/INFO]: [STDERR]: 	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
[Render thread/INFO]: [STDERR]: 	at oolloo.jlw.Wrapper.invokeMain(Wrapper.java:60)
[Render thread/INFO]: [STDERR]: 	at oolloo.jlw.Wrapper.main(Wrapper.java:53)

Relevant log.

latest.log

Additional information.

The version of "Slight Gui Modifications" is 2.6.1.

I don't believe this issue can be resolved on Sodium Extra's end because we are currently utilizing Sodium's vertex writer, which significantly improves GUI rendering speed.

There are a few potential solutions. First, Slight GUI modifications mixin injections could be relocated to drawTexture and drawSprite (yarn mapping) for https://github.com/shedaniel/slight-gui-modifications/blob/1.19.4/src/main/java/me/shedaniel/slightguimodifications/mixin/MixinGuiComponent.java.

Alternatively, users or the authors of the said mod can disable this optimization using our mixin config. Users can do so by adding mixin.optimizations.draw_helpers=false to .minecraft/config/sodium-extra.properties, while modders can achieve this by adding the following code below their fabric.mod.json:

  "custom": {
    "sodium-extra:options": {
      "mixin.optimizations.draw_helpers": false
    }
  }

So far, we haven't encountered any issues with other mods. If this optimization becomes too problematic, I will consider removing it altogether.

I will be leaving this issue open just for tracking the issue.