TotalFreedomMod/src/main/java/me/totalfreedom/totalfreedommod/command/Command_clearchat.java

31 lines
1009 B
Java
Raw Normal View History

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:42:46 +00:00
@CommandPermissions(level = Rank.TRIAL_MOD, 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:42:46 +00:00
if (!plugin.sl.isStaff(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:42:46 +00:00
FUtil.staffAction(sender.getName(), "Cleared chat", true);
2019-01-11 17:04:32 +00:00
return true;
}
2020-07-28 03:37:10 +00:00
}