Escape pipe character on item lore (#2831)

I just adjusted the regex used to split the item lore into multiple lines in order to allow escaping of the pipe character using \|.

Fixes #2830.
This commit is contained in:
Mark Vadeika 2019-12-23 08:15:26 -05:00 committed by md678685
parent a1a0d34940
commit 843ecb4a42

View File

@ -162,7 +162,7 @@ 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("\\|")) {
for (String line : split[1].split("[^\\\\](\\|)")) {
lore.add(FormatUtil.replaceFormat(line.replace('_', ' ')));
}
final ItemMeta meta = stack.getItemMeta();