diff --git a/src/main/java/pw/kaboom/extras/Commands.java b/src/main/java/pw/kaboom/extras/Commands.java index b802e56..b265cc1 100644 --- a/src/main/java/pw/kaboom/extras/Commands.java +++ b/src/main/java/pw/kaboom/extras/Commands.java @@ -35,10 +35,12 @@ import org.bukkit.scheduler.BukkitRunnable; class CommandClearChat implements CommandExecutor { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - for (int i = 0; i < 100; ++i) { - Bukkit.broadcastMessage(""); + for (Player onlinePlayer : Bukkit.getOnlinePlayers()) { + for (int i = 0; i < 100; ++i) { + onlinePlayer.sendMessage(""); + } + onlinePlayer.sendMessage(ChatColor.DARK_GREEN + "The chat has been cleared"); } - Bukkit.broadcastMessage(ChatColor.DARK_GREEN + "The chat has been cleared"); return true; } } @@ -265,7 +267,9 @@ class CommandTellraw implements CommandExecutor { if (args.length == 0) { player.sendMessage(ChatColor.RED + "Usage: /" + label + " "); } else { - Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args))); + for (Player onlinePlayer : Bukkit.getOnlinePlayers()) { + onlinePlayer.sendMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args))); + } } return true; } diff --git a/src/main/java/pw/kaboom/extras/Events.java b/src/main/java/pw/kaboom/extras/Events.java index 9c18063..77b38b2 100644 --- a/src/main/java/pw/kaboom/extras/Events.java +++ b/src/main/java/pw/kaboom/extras/Events.java @@ -572,7 +572,7 @@ class Events implements Listener { @EventHandler void onPlayerLogin(PlayerLoginEvent event) { - if ((event.getHostname().startsWith("play.kaboom.pw") && + if (!(event.getHostname().startsWith("play.kaboom.pw") && event.getHostname().endsWith(":64518"))) { event.disallow(Result.KICK_OTHER, "You connected to the server using an outdated server address/IP.\nPlease use the following address/IP:\n\nkaboom.pw"); } else {