Merge pull request #346 from Huskydog9988/show-chatgroup-on-join

Fix player's current chat group not showing on join
This commit is contained in:
okx-code
2024-03-16 19:57:37 +00:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -431,4 +431,8 @@ public class CivChat2Manager {
public void removeCustomName(UUID player) {
customNames.remove(player);
}
public ScoreboardHUD getScoreboardHUD() {
return scoreboardHUD;
}
}

View File

@@ -72,6 +72,9 @@ public class CivChat2Listener implements Listener {
p.sendMessage(playerJoinEvent.getPlayer().getDisplayName() + ChatColor.YELLOW + " has joined the game");
}
}
// Set current chat group in scoreboard
chatman.getScoreboardHUD().updateScoreboardHUD(playerJoinEvent.getPlayer());
if (CivChat2.getInstance().getPluginConfig().getChatRangeWarn() && !playerJoinEvent.getPlayer().hasPlayedBefore()) {
localWarn.add(playerJoinEvent.getPlayer().getUniqueId());