[SPIGOT-4035] ItemMeta - Different behavior with the § character Created: 17/Jul/18 Updated: 17/Jul/18 Resolved: 17/Jul/18 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | F_o_F_1092 | Assignee: | Hex |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Chat, ChatColor, ItemMeta | ||
| Attachments: |
|
| Version: | This server is running CraftBukkit version git-Spigot-11bdb29-a71d06a (MC: 1.13-pre7) (Implementing API version 1.13-pre7-R0.1-SNAPSHOT) |
| Description |
|
I have noticed that the § character has a different effect on the ItemsMeta in 1.13, and I think this could be a bug.
String text = "TEEEEEEEST"; String hiddenText = ""; for(char c : text.toCharArray()){ hiddenText += "§" + c; } //String hiddenText = "§T§E§E§E§E§E§E§E§S§T"; ItemStack is = new ItemStack(Material.STONE); ItemMeta itemMeta = is.getItemMeta(); itemMeta.setDisplayName(hiddenText); is.setItemMeta(itemMeta); Bukkit.broadcastMessage(hiddenText.replace("§", "")); Bukkit.broadcastMessage(itemMeta.getDisplayName().replace("§", ""));
1.12
1.13
|
| Comments |
| Comment by F_o_F_1092 [ 17/Jul/18 ] |
|
👍 |
| Comment by Hex [ 17/Jul/18 ] |
|
It's alright, we've determined it to be because CB parses color codes case-insensitively, which isn't vanilla behavior. It's fixed under CraftBukkit #447. |
| Comment by F_o_F_1092 [ 17/Jul/18 ] |
|
To be honest, I don't know how I could test this in vanilla Minecraft. |
| Comment by Hex [ 17/Jul/18 ] |
|
What's the behavior on vanilla? |