Don't broadcast to console

This commit is contained in:
mathias 2019-03-10 13:04:48 +02:00
parent 457fdefce2
commit 8eadbd89b1
2 changed files with 9 additions and 5 deletions

View file

@ -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 + " <message ..>");
} else {
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args)));
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.sendMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args)));
}
}
return true;
}

View file

@ -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 {