Destroy: Chemistry and Carnage

Destroy: Chemistry and Carnage

71 Downloads

[Bug] Crash when rendering tooltips in large modpack; consider using RegisterClientTooltipComponentFactoriesEvent?

unilock opened this issue ยท 2 comments

commented

I'm running into a strange crash when rendering tooltips in a very large modpack: crash-2024-02-08_08.25.51-client.txt

I think it might be related to the @Overwrite of ClientTooltipComponent#create here: https://github.com/petrolpark/Destroy/blob/8fcec92cefd2b0c65d0f86c9ef62b0647c30116f/src/main/java/com/petrolpark/destroy/mixin/ClientComponentTooltipMixin.java

As you probably already know, overwriting methods using Mixin (or anything else, really) can easily lead to incompatibilities with other mods, hence why I think it's part of the issue I'm having.

Have you considered using Forge's RegisterClientTooltipComponentFactoriesEvent? Likely as such:

public static void registerClientTooltipComponent(final RegisterClientTooltipComponentFactoriesEvent event) {
    event.register(DestroyTooltipComponent.class, DestroyTooltipComponent::getClientTooltipComponent);
}

(I'm not great with Forge, so the syntax may need adjusting there, but my IDE thinks it's OK...)

That should work much better than a full @Overwrite.

commented

I hadn't noticed that event. Destroy now uses it.

Is there anywhere I can get a version with that fix at the moment?

commented

I hadn't noticed that event. Destroy now uses it.