[SPIGOT-6013] item.getDisplayName does not include color codes Created: 21/Jul/20 Updated: 21/Jul/20 Resolved: 21/Jul/20 |
|
Status: | Closed |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Jumpin Carrot | Assignee: | Unassigned |
Resolution: | Done | Votes: | 0 |
Labels: | 1.16.1 |
Version: | 1.16.1 |
Guidelines Read: | Yes |
Description |
In my plugin i have to check if an item name is equal to a config string.
private static List<String> sorter_names = new ArrayList<>(Arrays.asList(sorter_primaryname)); ... return sorter_names.contains(item.getItemMeta().getDisplayName());
It has always worked well. But now all strings from the config have §r prefix in them. |
Comments |
Comment by Jumpin Carrot [ 21/Jul/20 ] |
It's probably a problem with my code i failed to see, combined with some changes in 1.16. Sorry. You can close this. |
Comment by blablubbabc [ 21/Jul/20 ] |
Can you make a concrete example? The item display names in the comment you posted and then deleted again did not contain any color or reset codes. I know that certain reset codes are not getting reproduced by getDisplayName currently (eg. reset codes at the beginning of the name, or if you have multiple resets in a row). Also, the order of color and formatting codes is important currently (formatting in front of colors ghet removed, because they have no effect). |
Comment by Jumpin Carrot [ 21/Jul/20 ] |
I was wrong. The problem is with item.getDisplayName(). Before 1.16 it had included color codes. Now it ignores them. Don't know if it's a bug or intentional. |
Comment by blablubbabc [ 21/Jul/20 ] |
Can you post your config entry with this string? |