mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-16 20:36:12 +00:00
28 lines
923 B
Java
28 lines
923 B
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import java.util.stream.IntStream;
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
|
@CommandParameters(description = "Clears the chat for players who are not opt-out.", usage = "/<command>", aliases = "cc")
|
|
public class Command_clearchat extends FreedomCommand
|
|
{
|
|
|
|
@Override
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
{
|
|
|
|
for (Player player : server.getOnlinePlayers())
|
|
{
|
|
if (!plugin.al.isAdmin(player))
|
|
{
|
|
IntStream.range(0, 100).mapToObj(i -> "").forEach(player::sendMessage);
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
} |