package org.bukkit.craftbukkit; import java.util.ArrayList; import java.util.List; import org.bukkit.ChatColor; public class TextWrapper { public static List wrapText(final String text) { ArrayList output = new ArrayList(); String[] lines = text.split("\n"); String lastColor = null; for (int i = 0; i < lines.length; i++) { String line = lines[i]; if (lastColor != null) { line = lastColor + line; } output.add(line); lastColor = ChatColor.getLastColors(line); } return output; } }