[1.18.2] Tooltip glitch with Tinker's ranged weapons
ffuentesm opened this issue ยท 1 comments
Oh hey, there is an issue for this already. I can contribute some information then.
The same issue can be produced with Immersive Engineering's revolvers, if they provide the player with a Luck bonus:
BluSunrize/ImmersiveEngineering#5584
If I strip out the extra tootip image that we add, the issue persists:
I did some debugger stepping through Quark's code and figured out some details of what is happening here:
-
Quark correctly adds two
AttributeComponent
s to the tooltip. One for mainhand, one for offhand.
-
These attribute components contain no reference to what slot they are for. As a result of that, when they get rendered, they render information for all
EquipmentSlot
s that the item provides any attributes for:
https://github.com/VazkiiMods/Quark/blob/master/src/main/java/vazkii/quark/content/client/tooltip/AttributeTooltips.java#L289
I don't fully understand what the approach is here. If initial event handler already splits information by different equipment slots, then I woul assume the AttributeComponent
to store a reference to that very slot, instead of doing that entire parsing logic again and then rendering it double.