Skip to content

Commit

Permalink
Fix bugs with AFK tag not appearing
Browse files Browse the repository at this point in the history
  • Loading branch information
SquaredHelix committed Feb 8, 2020
1 parent f3bc460 commit 88cace3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>me.kristoffer</groupId>
<artifactId>vanillaplus</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
<name>VanillaPlus</name>

<properties>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/me/kristoffer/vanillaplus/modules/Nametag.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ public void onJoin(PlayerJoinEvent event) {

private void updateName(Player player, AsyncPlayerChatEvent chatEvent) {
Scoreboard sb = Bukkit.getServer().getScoreboardManager().getMainScoreboard();
Team team = sb.getEntryTeam(player.getName());
if (!(sb.getEntryTeam(player.getName()) != null)) {
return;
if (sb.getEntryTeam(player.getName()) == null) {
sb.getTeam("cf").addEntry(player.getName());
}
Team team = sb.getEntryTeam(player.getName());
player.setPlayerListName(team.getPrefix() + player.getName());
if (team.getName().equals("rainbow")) {
if (chatEvent != null) {
Expand All @@ -158,7 +158,8 @@ private void updateName(Player player, AsyncPlayerChatEvent chatEvent) {
team.getColor() + player.getDisplayName() + ChatColor.RESET + ": " + chatEvent.getMessage());
}
if (afkPlayers.contains(player.getName())) {
player.setPlayerListName(ChatColor.YELLOW + "[AFK] " + team.getPrefix() + player.getName());
player.setPlayerListName(
ChatColor.YELLOW + "[AFK] " + team.getColor() + team.getPrefix() + player.getName());
}
}
}
Expand Down

0 comments on commit 88cace3

Please sign in to comment.