mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 04:23:02 +00:00
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:
parent
a1a0d34940
commit
843ecb4a42
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ public class MetaItemStack {
|
||||||
stack.setItemMeta(meta);
|
stack.setItemMeta(meta);
|
||||||
} else if (split.length > 1 && (split[0].equalsIgnoreCase("lore") || split[0].equalsIgnoreCase("desc")) && hasMetaPermission(sender, "lore", false, true, ess)) {
|
} 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>();
|
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('_', ' ')));
|
lore.add(FormatUtil.replaceFormat(line.replace('_', ' ')));
|
||||||
}
|
}
|
||||||
final ItemMeta meta = stack.getItemMeta();
|
final ItemMeta meta = stack.getItemMeta();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue