Ensure roleMappings are updated when team is made

This commit is contained in:
William 2023-02-26 20:00:02 +00:00
parent 0a39899705
commit 6cea56364e
No known key found for this signature in database

View File

@ -40,6 +40,7 @@ public class ScoreboardManager {
if (!createdTeams.getOrDefault(player.getUniqueId(), List.of()).contains(role)) {
dispatchPacket(UpdateTeamsPacket.create(role, playerNames), player);
createdTeams.computeIfAbsent(player.getUniqueId(), k -> new ArrayList<>()).add(role);
roleMappings.computeIfAbsent(player.getUniqueId(), k -> new HashMap<>()).put(player.getUsername(), role);
} else {
roleMappings.getOrDefault(player.getUniqueId(), Map.of())
.entrySet().stream()