Open CubBossa opened 4 months ago
Assuming there were a <repeat:_amount_> tag, a wrapping gradient tag would not be able to apply its gradient correctly scaled on the repeated content.
<repeat:_amount_>
The code that I used for the repeat tag to reproduce this was
return (Modifying) (current, depth) -> { if (depth > 0) return Component.empty(); Component c = Component.empty(); for (int i = 0; i < count; i++) { c = c.append(current); } return c; }
Against what I expected, <gradient:black:dark_gray:black><repeat:12>-</repeat><slot/> produced gradients scaled on <slot/>#length + 1 only
<gradient:black:dark_gray:black><repeat:12>-</repeat><slot/>
<slot/>#length + 1
From what code I found online, it looks like gradient tags only take child Inserting tags into account and not child Modifying tags. https://github.com/KyoriPowered/adventure/blob/aeaeb9939b3bddc66c219f66e1fe43b997c9d41a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/AbstractColorChangingTag.java#L82
Assuming there were a
<repeat:_amount_>
tag, a wrapping gradient tag would not be able to apply its gradient correctly scaled on the repeated content.The code that I used for the repeat tag to reproduce this was
Against what I expected,![grafik](https://github.com/KyoriPowered/adventure/assets/66269026/0025ee40-b05a-4875-9ae6-b7fd3fcc32da)
<gradient:black:dark_gray:black><repeat:12>-</repeat><slot/>
produced gradients scaled on<slot/>#length + 1
onlyFrom what code I found online, it looks like gradient tags only take child Inserting tags into account and not child Modifying tags. https://github.com/KyoriPowered/adventure/blob/aeaeb9939b3bddc66c219f66e1fe43b997c9d41a/text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/tag/standard/AbstractColorChangingTag.java#L82