2019-01-11 17:04:32 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
2020-07-28 03:37:10 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
2019-01-11 17:04:32 +00:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2020-08-15 22:41:23 +00:00
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
2020-07-28 03:37:10 +00:00
|
|
|
@CommandParameters(description = "Clears the chat.", usage = "/<command>", aliases = "cc")
|
2019-01-11 17:04:32 +00:00
|
|
|
public class Command_clearchat extends FreedomCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
2020-06-30 07:25:38 +00:00
|
|
|
for (Player player : server.getOnlinePlayers())
|
2019-01-11 17:04:32 +00:00
|
|
|
{
|
2020-08-15 22:41:23 +00:00
|
|
|
if (!plugin.al.isAdmin(player))
|
2019-01-12 03:05:12 +00:00
|
|
|
{
|
2020-07-28 03:37:10 +00:00
|
|
|
for (int i = 0; i < 100; i++)
|
|
|
|
{
|
|
|
|
player.sendMessage("");
|
|
|
|
}
|
2019-01-12 03:05:12 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-15 22:41:23 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Cleared chat", true);
|
2019-01-11 17:04:32 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-07-28 03:37:10 +00:00
|
|
|
}
|