Skip to content

Commit

Permalink
Fix issue when Description separator loses selected color (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Feb 12, 2019
1 parent ab3275c commit 8f3beb4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/world/bentobox/challenges/utils/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,17 @@ public static List<String> stringSplit(String string, int warpLength)
map(line -> Arrays.asList(WordUtils.wrap(line, warpLength).split(System.getProperty("line.separator")))).
forEach(result::addAll);

// Fix colors, as splitting my lost that information.

for (int i = 0, resultSize = result.size(); i < resultSize; i++)
{
if (i > 0)
{
String lastColor = ChatColor.getLastColors(result.get(i - 1));
result.set(i, lastColor + result.get(i));
}
}

return result;
}

Expand Down

0 comments on commit 8f3beb4

Please sign in to comment.