Dieser Commit ist enthalten in:
Ursprung
3ecd31e80c
Commit
2ccc7920d5
@ -53,7 +53,7 @@ public class BauScoreboard implements Listener {
|
||||
Region region = Region.getRegion(player.getLocation());
|
||||
|
||||
List<String> elements = new ArrayList<>();
|
||||
calcGroup(elements, "§0", region, ScoreboardElement.ScoreboardGroup.HEADER);
|
||||
calcGroup(elements, null, region, ScoreboardElement.ScoreboardGroup.HEADER);
|
||||
calcGroup(elements, "§1", region, ScoreboardElement.ScoreboardGroup.REGION);
|
||||
calcGroup(elements, "§2", region, ScoreboardElement.ScoreboardGroup.OTHER);
|
||||
calcGroup(elements, "§3", region, ScoreboardElement.ScoreboardGroup.FOOTER);
|
||||
@ -67,26 +67,26 @@ public class BauScoreboard implements Listener {
|
||||
}
|
||||
|
||||
private void calcGroup(List<String> elements, String separator, Region region, ScoreboardElement.ScoreboardGroup group) {
|
||||
if (ELEMENTS.containsKey(group)) {
|
||||
List<String> groupElements = new ArrayList<>();
|
||||
if (ELEMENTS.containsKey(group)) {
|
||||
for (ScoreboardElement element : ELEMENTS.get(group)) {
|
||||
groupElements.add(element.get(region, player));
|
||||
}
|
||||
groupElements.removeIf(Objects::isNull);
|
||||
if (!groupElements.isEmpty()) {
|
||||
elements.add(separator);
|
||||
elements.addAll(groupElements);
|
||||
}
|
||||
}
|
||||
if (ADDITIONAL_SCOREBOARD_LINES.containsKey(player)) {
|
||||
ADDITIONAL_SCOREBOARD_LINES.get(player).values()
|
||||
.stream()
|
||||
.filter(triple -> triple.getLeft() == group)
|
||||
.sorted(Comparator.comparing(triple -> triple.getMiddle()))
|
||||
.sorted(Comparator.comparing(MutableTriple::getMiddle))
|
||||
.forEach(triple -> {
|
||||
elements.add(triple.getRight());
|
||||
groupElements.add(triple.getRight());
|
||||
});
|
||||
}
|
||||
groupElements.removeIf(Objects::isNull);
|
||||
if (!groupElements.isEmpty()) {
|
||||
if (separator != null) elements.add(separator);
|
||||
elements.addAll(groupElements);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren