package me.totalfreedom.totalfreedommod.commands; import me.totalfreedom.totalfreedommod.permission.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 = "adminchat") public class Command_o extends FreedomCommand { @Override public boolean run(CommandSender sender, Player sender_p, 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(sender_p); userinfo.setAdminChat(!userinfo.inAdminChat()); playerMsg("Toggled Admin Chat " + (userinfo.inAdminChat() ? "on" : "off") + "."); } else { FUtil.adminChatMessage(sender, StringUtils.join(args, " "), senderIsConsole); } return true; } }