CaffeineMC / sodium-fabric

A Minecraft mod designed to improve frame rates and reduce micro-stutter
Other
4.72k stars 806 forks source link

Crash when hovering on enchanted elytra icon #1602

Open N-Ved opened 1 year ago

N-Ved commented 1 year ago

Version information

mc1.19.3, sodium fabric 0.4.9

Reproduction Steps

  1. Put an enchanted elytra on your chest
  2. hover over it

Crash Report file

https://pastebin.com/dseQicZL

Additional information

This only started after updating sodium

jellysquid3 commented 1 year ago

oh god

N-Ved commented 1 year ago

oh god

Just made it a pastebin for the eyes

N-Ved commented 1 year ago

you guys got a discord sever or something?

jellysquid3 commented 1 year ago

My comment was in reference to the problem at hand.

The mod "Iceberg" is using a custom VertexConsumer (apparently mods actually do that) and Sodium can't deal with it. The other mod's author would need to implement VertexBufferWriter on their implementation, or we need to add a fallback path that somehow allows a generic VertexConsumer interface to be wrapped by Sodium.

N-Ved commented 1 year ago

So its another mod which is causing the problem? Sorry, I dont quite get what you mean by "The mod".. Sodium or some other mod?

jellysquid3 commented 1 year ago

You can join the Discord server via this link.

Timolino456 commented 1 year ago

Incase anyone with the same crash is reading this: you'll need to either use Sodium 0.4.8 or disable 3D item previews in the Legendary Tooltips config for now.

Sollace commented 1 year ago

Just throwing my hat in to mention that two of my mods are affected by this. (Unicopia and Phychedelicraft use essentially the same code)

It is a hack, but a hack that's unfortunately neccessary given the way Mojang has decided to design things.

Sollace commented 1 year ago

Creating a code-path that wraps it, as suggested, is the preferred approach in my opinion.

creed-us commented 1 year ago

It seems you're well-aware of this issue, regardless, here's my crash log as well; https://pastebin.com/2uR6r65S

pajicadvance commented 1 year ago

Just a quick heads up: The latest version of the Iceberg mod (1.1.10) is designed to work with the now pulled Sodium 0.4.11 update, and doesn't work with Sodium 0.4.10. In order to use Iceberg and the mods that depend on it with Sodium 0.4.10, you need to downgrade Iceberg to 1.1.8.

douira commented 1 year ago

The API for this is being re-added with sodium 0.5 https://github.com/CaffeineMC/sodium-fabric/issues/1620

Sollace commented 1 year ago

For anyone encountering this issue, until Sodium has an official solution, I'm going to share how I fixed my specific case:

Since sodium already injects their interface into all of the vanilla VertexConsumer implementations, and my custom VertexConsumer wrapped a regular one, with selective overrides for color, texture, light, etc, I was able to get compatibility with current Sodium by simply rewriting my code to extend the VertexConsumers.Union class (with access widener to make it visible).

I could then add pass the parent to the super constructor, so effectively you have a union of 1 vertex consumers, and added my overrides into that class with them calling super.color(r, g, b, a) in the place of parent.color(r, g, b, a).

You could just keep the parent field and call methods on it directly, but I chose to do it via calling the super methods in the interest of maintaining compatibility in case Sodium or anyone else is adding special logic that I'm not aware of.