mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 09:55:36 -05:00
Don't broadcast to console
This commit is contained in:
parent
457fdefce2
commit
8eadbd89b1
2 changed files with 9 additions and 5 deletions
|
@ -35,10 +35,12 @@ import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
class CommandClearChat implements CommandExecutor {
|
class CommandClearChat implements CommandExecutor {
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
for (int i = 0; i < 100; ++i) {
|
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||||
Bukkit.broadcastMessage("");
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -265,7 +267,9 @@ class CommandTellraw implements CommandExecutor {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
player.sendMessage(ChatColor.RED + "Usage: /" + label + " <message ..>");
|
player.sendMessage(ChatColor.RED + "Usage: /" + label + " <message ..>");
|
||||||
} else {
|
} else {
|
||||||
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args)));
|
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||||
|
onlinePlayer.sendMessage(ChatColor.translateAlternateColorCodes('&', String.join(" ", args)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -572,7 +572,7 @@ class Events implements Listener {
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
void onPlayerLogin(PlayerLoginEvent event) {
|
void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
if ((event.getHostname().startsWith("play.kaboom.pw") &&
|
if (!(event.getHostname().startsWith("play.kaboom.pw") &&
|
||||||
event.getHostname().endsWith(":64518"))) {
|
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");
|
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 {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue