mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-24 00:51:37 +01:00
Properly escape pipe character on item lore (#2994)
Using negative lookbehind instead of negated characters set. Fixes #2962, fixes #2984
This commit is contained in:
parent
129650dade
commit
13f454a022
@ -162,8 +162,8 @@ public class MetaItemStack {
|
||||
stack.setItemMeta(meta);
|
||||
} else if (split.length > 1 && (split[0].equalsIgnoreCase("lore") || split[0].equalsIgnoreCase("desc")) && hasMetaPermission(sender, "lore", false, true, ess)) {
|
||||
final List<String> lore = new ArrayList<String>();
|
||||
for (String line : split[1].split("[^\\\\](\\|)")) {
|
||||
lore.add(FormatUtil.replaceFormat(line.replace('_', ' ')));
|
||||
for (String line : split[1].split("(?<!\\\\)\\|")) {
|
||||
lore.add(FormatUtil.replaceFormat(line.replace('_', ' ').replace("\\|", "|")));
|
||||
}
|
||||
final ItemMeta meta = stack.getItemMeta();
|
||||
meta.setLore(lore);
|
||||
|
Loading…
Reference in New Issue
Block a user