2020-01-11 22:44:13 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
|
|
|
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
|
|
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.TELNET_ADMIN, source = SourceType.BOTH)
|
2020-03-30 23:43:57 +00:00
|
|
|
@CommandParameters(description = "Toggle online players' ability to chat.", usage = "/<command>", aliases = "tc")
|
2020-01-11 22:44:13 +00:00
|
|
|
public class Command_togglechat extends FreedomCommand
|
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
|
|
|
ConfigEntry.TOGGLE_CHAT.setBoolean(!ConfigEntry.TOGGLE_CHAT.getBoolean());
|
2020-08-15 22:41:23 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Chat " + (ConfigEntry.TOGGLE_CHAT.getBoolean() ? "enabled" : "disabled") + ".", true);
|
2020-01-11 22:44:13 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|