SpaceCat97 / SpaceCats-Wikis

Other
2 stars 0 forks source link

Incompatible with Obscure API #13

Closed Karashok-Leo closed 5 months ago

Karashok-Leo commented 5 months ago

When I install both ASB and Obscure API at the same time, the tooltip of ASB cannot be displayed properly.

SpaceCat97 commented 5 months ago

Are you sure it is the api? Could it be their tooltips mod that causes the issue?

Karashok-Leo commented 5 months ago

Are you sure it is the api? Could it be their tooltips mod that causes the issue?

They should have done something about tooltip. I'm not sure because both sides are closed source.

SpaceCat97 commented 5 months ago

I am speaking about this mod - https://www.curseforge.com/minecraft/mc-mods/obscure-tooltips

if you remove it from your pack, does it still break?

Karashok-Leo commented 5 months ago

I am speaking about this mod - https://www.curseforge.com/minecraft/mc-mods/obscure-tooltips

if you remove it from your pack, does it still break?

I did not install obscure-tooltips, only the API. I have repeatedly confirmed it. I also posted an issue in their discord.

SpaceCat97 commented 5 months ago

Thank you for confirming. I will see if I can solve anything on my end.

SpaceCat97 commented 5 months ago

I have just tested ASB with Obscure API installed. It worked with no issues at all.

Please find the root cause of your problem. Only then will I be able to help you. 2024-02-06_14 33 54

Karashok-Leo commented 5 months ago

latest.log I checked again, but there is still a problem. mods:

I have just tested ASB with Obscure API installed. It worked with no issues at all.

Please find the root cause of your problem. Only then will I be able to help you. 2024-02-06_14 33 54

Karashok-Leo commented 5 months ago

2024-02-06_22 50 21 2024-02-06_22 51 16 The two images show the effects before and after installing Obscure API.

SpaceCat97 commented 5 months ago

I tested on forge, your issue is on fabric. My mod adds tooltips by injecting into the ItemTooltipEvent for forge.

For fabric, my mod uses a mixin to inject into the getTooltipLines method and add entries to the Component List. I am not sure how obscure api does this but they probably also mess with that method which breaks my mod.

I am looking into another way to register tooltips for fabric which will hopefully fix this issue. The potential fix will be released in the next 1.20 version of this mod.

Karashok-Leo commented 5 months ago

I tested on forge, your issue is on fabric. My mod adds tooltips by injecting into the ItemTooltipEvent for forge.

For fabric, my mod uses a mixin to inject into the getTooltipLines method and add entries to the Component List. I am not sure how obscure api does this but they probably also mess with that method which breaks my mod.

I am looking into another way to register tooltips for fabric which will hopefully fix this issue. The potential fix will be released in the next 1.20 version of this mod.

Thank you for your patience. But fabric API provides an event related to tooltips, why not use it (just out of curiosity)

SpaceCat97 commented 5 months ago

Originally I did a mixin because the fabric event does not pass the player object through. I have an idea that may work.

Karashok-Leo commented 5 months ago

Originally I did a mixin because the fabric event does not pass the player object through. I have an idea that may work.

Got it. thx

SpaceCat97 commented 5 months ago

Just managed to change the way tooltips are registered on fabric, you can expect to see this fix in the next version 1.20+ only

SpaceCat97 commented 5 months ago

Fix applied to 20.11.0