Skip to content

Commit

Permalink
Color codes were not working for challenge lore.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jul 24, 2017
1 parent 0d170d7 commit eebd5ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/com/wasteofplastic/askyblock/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.bukkit.Bukkit;
Expand Down Expand Up @@ -122,6 +123,11 @@ public static void saveYamlFile(YamlConfiguration yamlFile, String fileLocation)
*/
public static List<String> chop(ChatColor color, String longLine, int length) {
List<String> result = new ArrayList<String>();
if (longLine.contains("|") || longLine.contains("§")) {
// Split pip character requires escaping it
String[] split = longLine.split("\\|");
return new ArrayList<String>(Arrays.asList(split));
}
// int multiples = longLine.length() / length;
int i = 0;
for (i = 0; i < longLine.length(); i += length) {
Expand Down

0 comments on commit eebd5ed

Please sign in to comment.