diff --git a/Essentials/src/com/earth2me/essentials/MetaItemStack.java b/Essentials/src/com/earth2me/essentials/MetaItemStack.java index dbe30cfde..7b9667e77 100644 --- a/Essentials/src/com/earth2me/essentials/MetaItemStack.java +++ b/Essentials/src/com/earth2me/essentials/MetaItemStack.java @@ -7,6 +7,8 @@ import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.NumberUtil; import com.google.common.base.Joiner; import net.ess3.api.IEssentials; + +import org.apache.commons.lang.ArrayUtils; import org.bukkit.Color; import org.bukkit.DyeColor; import org.bukkit.FireworkEffect; @@ -117,6 +119,27 @@ public class MetaItemStack { } public void parseStringMeta(final CommandSource sender, final boolean allowUnsafe, String[] string, int fromArg, final IEssentials ess) throws Exception { + // Make any entries after lore definition become the lore and not parsed. + { + int loreIndex = -1; + boolean dirty = false; + for (int i = 0; i < string.length; i++) { + String _str = string[i]; + if (loreIndex == -1) { + if (_str.matches("^lore" + splitPattern.pattern() + ".*")) { + System.out.println("YES " + _str); + loreIndex = i; + } + } else { + string[loreIndex] += " " + string[i]; + string[i] = null; + dirty = true; + } + } + if (dirty) { + string = (String[]) ArrayUtils.subarray(string, 0, loreIndex + 1); + } + } if (string[fromArg].startsWith("{") && hasMetaPermission(sender, "vanilla", false, true, ess)) { try { stack = ess.getServer().getUnsafe().modifyItemStack(stack, Joiner.on(' ').join(Arrays.asList(string).subList(fromArg, string.length)));