[SPIGOT-5845] ChatColor.RESET does not work in ItemMeta to reset italics Created: 26/Jun/20 Updated: 27/Jun/20 Resolved: 27/Jun/20 |
|
Status: |
Resolved |
Project: |
|
Component/s: |
None |
Affects Version/s: |
None |
Fix Version/s: |
None |
Type: |
Bug |
Priority: |
Minor |
Reporter: |
Assignee: |
Unassigned |
|
Resolution: |
Fixed |
Votes: |
0 |
ChatColor, itemmeta |
Attachments: |
TestPlugin.jar |
git-Spigot-16d7899-4ff609e (MC: 1.16.1) (API version 1.16.1-R0.1-SNAPSHOT) |
|
Yes |
Description |
|
Comments |
|
Comment by Aria Sangarin [ 26/Jun/20 ] |
Can confirm Doesn't matter if you use Bungee or Bukkit ChatColor happens on both. Not even the code below makes it non-italic. ChatColor.RESET + "Test" |
Comment by md_5 [ 26/Jun/20 ] |
I suggest you test
vanilla. |
Comment by Aria Sangarin [ 26/Jun/20 ] |
That's the thing, they're italic by default, but 1.15 and below
let you 'reset' this behavior. Currently we can only use `#setDisplayName(String)` and `#setLore(List<String>)` using the ItemMeta class, which doesn't allow us to put that needed JSON line in there, so hacky workarounds or NMS is required to remove the italics from items. (not tested tho) |
Comment by md_5 [ 26/Jun/20 ] |
Yes so the bug is not that
ChatColor causes italics, it Is that ChatColor.RESET does not
remove italics. |
Comment by Aria Sangarin [ 26/Jun/20 ] |
Ahh, true, didn't think of
it that way! |
Comment by JishunaMatata [ 26/Jun/20 ] |
If I remember correctly, just having ChatColor.RED + text in 1.15 would make the text non-italic without needing ChatColor.RESET |
Comment by Aria Sangarin [ 26/Jun/20 ] |
@JishunaMatata Yeah, this also isn't a thing anymore. ChatColor.RED + text will indeed make the text red, but it will still be in italics when using 1.16.1 |
Comment by md_5 [ 26/Jun/20 ] |
Red shouldn't reset italics so I think that's more Spigot aligning with Vanilla behaviour better now, again test /give in Vanilla |
Comment by JishunaMatata [ 26/Jun/20 ] |
After testing I can confirm changing the color of text in vanilla does not reset the formatting, tested with the following command test2 will also be italic. /give @p minecraft:stick{display:{Name:'[{"text":"test ","italic":true},{"text":"test2","color":"red"}]'}} 1 |
Comment by Aria Sangarin [ 26/Jun/20 ] |
Yeah, I suppose it aligns better with vanilla, but now there is no way for a plugin to remove italics from custom name/lore as there is no way to set italics to false using the setDisplayName and setLore ItemMeta methods, which breaks all the nicely formatted items from past versions |
Comment by md_5 [ 27/Jun/20 ] |
Color is such a mess. Hopefully the updated behaviour is at least acceptable. |
Comment by Aria Sangarin [ 27/Jun/20 ] |
Works like a charm, thank you |
Generated at Sun Oct 24 10:59:20 UTC 2021 using Jira 8.20.0#820000-sha1:12d32736019f23930cfd2092dd230e869932e04a.
Tags: [spigot5845], reset, itemmeta, chatcolorreset