Quark Oddities

Quark Oddities

22M Downloads

[1.18.2] Tooltip glitch with Tinker's ranged weapons

ffuentesm opened this issue ยท 1 comments

commented

The Quark Tooltips for ranged weapons are messing with Tinker's new ranged weapons.
This does not happen with melee weapons.
Tinker's: 3.6.0.73
Quark: 3.2-358
Forge: 40.1.93
image

commented

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:
grafik

I did some debugger stepping through Quark's code and figured out some details of what is happening here:

  1. Quark correctly adds two AttributeComponents to the tooltip. One for mainhand, one for offhand.
    grafik

  2. 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 EquipmentSlots 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.