package me.totalfreedom.totalfreedommod.commands; import me.totalfreedom.totalfreedommod.rank.PlayerRank; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang3.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @CommandPermissions(level = PlayerRank.SUPER_ADMIN, source = SourceType.BOTH) @CommandParameters( description = "AdminChat - Talk privately with other admins. Using itself will toggle AdminChat on and off for all messages.", usage = "/ [message...]", aliases = "o,ac") public class Command_adminchat extends FreedomCommand { @Override public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 0) { if (senderIsConsole) { playerMsg("Only in-game players can toggle AdminChat."); return true; } FPlayer userinfo = plugin.pl.getPlayer(playerSender); userinfo.setAdminChat(!userinfo.inAdminChat()); playerMsg("Toggled Admin Chat " + (userinfo.inAdminChat() ? "on" : "off") + "."); } else { FUtil.adminChatMessage(sender, StringUtils.join(args, " "), senderIsConsole); } return true; } }