Sort Minecraft Java Tablist Ranks?

fr
3

Yesterday I programmed this code which sets me a scoreboard and displays ranks (in the tablist), but the normal player is now under management, how can I sort that?

Code:

sb.getTeam ( "999default") setPrefix ( "Section 7").

sb.getTeam ("003dev"). SetPrefix ("§4admin §8 | §4");

sb.getTeam ("002srdev"). SetPrefix ("§4line §8 | §4");

sb.getTeam ("001admin"). SetPrefix ("§4Line §8 | §4");

sb.getTeam ("000leitung"). SetPrefix ("§4Leitung §8 | §4");

}

}

private static void registerNewTeam (Scoreboard sb, String teamName, String teamPrefix, String teamSuffix, String playerNameToAdd) {

Team t = sb.registerNewTeam (teamName);

t.setPrefix (teamPrefix);

t.setSuffix (teamSuffix);

t.addEntry (playerNameToAdd);

}

private static void registerNewRankedTeam (Scoreboard sb, String teamName, String teamPrefix, String teamSuffix, String permission) {

Team t = sb.registerNewTeam (teamName);

t.setPrefix (teamPrefix);

t.setSuffix (teamSuffix);

for (Player all: Bukkit.getOnlinePlayers ()) {

if ((sb.getEntryTeam (all.getName ()) == null)) {

Functions.PrintConsole ("add player");

t.addEntry (all.getName ());

}

if (! Permission.equalsIgnoreCase ( "NONE"))

{

Functions.PrintConsole ( "permission");

if (all.hasPermission (permission))

all.setDisplayName (teamPrefix + all.getName () + teamSuffix);

}

else

{

Functions.PrintConsole ("no permission");

all.setDisplayName (teamPrefix + all.getName () + teamSuffix);

}

}

/ *

if (! (permission.equalsIgnoreCase ("NONE" {

for (Player all: Bukkit.getOnlinePlayers ()) {

if ((sb.getEntryTeam (all.getName ()) == null) && all.hasPermission (permission)) {

t.addEntry (all.getName ());

all.setDisplayName (teamPrefix + all.getName () + teamSuffix);

}

}

} else {

for (Player all: Bukkit.getOnlinePlayers ()) {

if ((sb.getEntryTeam (all.getName ()) == null)) {

t.addEntry (all.getName ());

all.setDisplayName (teamPrefix + all.getName () + teamSuffix);

}

}

}

* /

}

}
've got something down ge / ** / because I was trying on!

could not send the whole code, because it was too long but I think the most important thing is inside!

vo

Upload code properly. Format correctly or with pastebin.

fr

Okay right, I did not remember!

fr

https://hasteb.in/tejeyiza.java
I know that the conventions etc were not respected.