Crash when hovering on enchanted elytra icon
N-Ved opened this issue ยท 14 comments
Version information
mc1.19.3, sodium fabric 0.4.9
Reproduction Steps
- Put an enchanted elytra on your chest
- hover over it
Crash Report file
Additional information
This only started after updating sodium
You can join the Discord server via this link.
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?
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.
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.
It seems you're well-aware of this issue, regardless, here's my crash log as well;
https://pastebin.com/2uR6r65S
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.
Creating a code-path that wraps it, as suggested, is the preferred approach in my opinion.
Same for me
https://pastebin.com/HmPziiqk
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.
The API for this is being re-added with sodium 0.5 #1620
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.