Possible workaround for #57. Bump version number

This commit is contained in:
HappyPikachu 2017-07-21 17:06:58 -04:00
parent 784dca4cb4
commit 12cdea0536
3 changed files with 17 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.9.2</version>
<version>2.9.3</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -2515,7 +2515,12 @@ public class Quester {
meta.setDisplayName(ChatColor.DARK_PURPLE + Quests.parseString(quests.get(i).getName(), npc));
if (!meta.hasLore()) {
LinkedList<String> lines = new LinkedList<String>();
lines = MiscUtil.makeLines(quests.get(i).description, " ", 40, ChatColor.DARK_GREEN);
String desc = quests.get(i).description;
if (desc == ChatColor.stripColor(quests.get(i).description)) {
lines = MiscUtil.makeLines(quests.get(i).description, " ", 40, ChatColor.DARK_GREEN);
} else {
lines = MiscUtil.makeLines(quests.get(i).description, " ", 40, null);
}
meta.setLore(lines);
}
display.setItemMeta(meta);

View File

@ -97,7 +97,11 @@ public class MiscUtil {
int currentLength = 0;
for (String piece : split) {
if ((currentLength + piece.length()) > (lineLength + 1)) {
toReturn.add(lineColor + line.replaceAll("^" + wordDelimiter, ""));
if (lineColor != null) {
toReturn.add(lineColor + line.replaceAll("^" + wordDelimiter, ""));
} else {
toReturn.add(line.replaceAll("^" + wordDelimiter, ""));
}
line = piece + wordDelimiter;
currentLength = piece.length() + 1;
} else {
@ -106,7 +110,11 @@ public class MiscUtil {
}
}
if (line.equals("") == false)
toReturn.add(lineColor + line);
if (lineColor != null) {
toReturn.add(lineColor + line);
} else {
toReturn.add(line);
}
return toReturn;
}
}