Refactored and fixed chat formatting, deploy to Releases #116

Merged
NorbiPeti merged 10 commits from dev into master 2020-03-04 22:13:07 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit aad65e0222 - Show all commits

View file

@ -265,7 +265,7 @@ public class ChatProcessing {
System.out.println(message);
};
if (names.length > 0) //Add as first so it handles special characters (_) - TODO: But after URLs
if (names.length > 0) //Add as first so it handles special characters (_) - though the order of the different types are defined
formatters.add(0, new StringMatchProvider("name", FormatSettings.builder().color(Color.Aqua)
.onmatch((match, builder, section) -> {
Player p = Bukkit.getPlayer(match);

View file

@ -260,7 +260,7 @@ public final class ChatFormatter {
private static void sortSections(ArrayList<FormattedSection> sections) {
sections.sort(
(s1, s2) -> s1.Start == s2.Start
? s1.End == s2.End ? 0 : Integer.compare(s1.End, s2.End) //TODO: Test
? s1.End == s2.End ? 0 : Integer.compare(s1.End, s2.End)
: Integer.compare(s1.Start, s2.Start));
}