mirror of
https://github.com/kaboomserver/extras.git
synced 2024-10-31 16:59:24 +00:00
Make clearchat sendMessage to individual players instead of broadcasting
This commit is contained in:
parent
04b8ce1c3c
commit
be3149dc7a
|
@ -6,6 +6,7 @@ import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
@ -22,10 +23,12 @@ public final class CommandClearChat implements CommandExecutor {
|
||||||
.append(Component.newline());
|
.append(Component.newline());
|
||||||
}
|
}
|
||||||
|
|
||||||
Bukkit.getServer().broadcast(clearChatComponent
|
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||||
.append(Component
|
onlinePlayer.sendMessage(clearChatComponent
|
||||||
.text("The chat has been cleared",
|
.append(Component
|
||||||
NamedTextColor.DARK_GREEN)));
|
.text("The chat has been cleared",
|
||||||
|
NamedTextColor.DARK_GREEN)));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue