Only send join message on player's first join #36
|
|
@ -58,7 +58,12 @@ public final class Main extends JavaPlugin implements Listener {
|
||||||
public void onJoin(PlayerJoinEvent event) {
|
public void onJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
// event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName());
|
||||||
|
if (player.hasPlayedBefore()) {
|
||||||
|
event.setJoinMessage(null);
|
||||||
|
} else {
|
||||||
event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName());
|
event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName());
|
||||||
|
}
|
||||||
|
|
||||||
setupPlayer(player);
|
setupPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user