/** * * GOD - allows player to ignore incomming damage * * @param sender * @param args * @return */ public static Boolean run(CommandSender sender, String alias, String[] args) { if (PlayerHelper.checkIsPlayer(sender) && !Utils.checkCommandSpam((Player) sender, "god")) { // check if we have any parameters if ((args.length == 0) && Permissions.checkPerms((Player) sender, "cex.god") || (args.length > 0) && Permissions.checkPerms((Player) sender, "cex.god.others")) { god(sender, args, "god", alias); } } return true; }
/** * * When player dies, save their back position, so they can return if they have permissions to do * so. * * @param e * @return */ @EventHandler(priority = EventPriority.NORMAL) public void saveBackPosition(PlayerDeathEvent e) { Player p = e.getEntity(); if (!Permissions.checkPermEx(p, "cex.back.deathcoords")) return; String pName = p.getName(); Command_cex_back.lastLocations.put(pName, p.getLocation()); }
/** * * UNMUTE - unmutes a player * * @param sender * @param args * @return */ public static Boolean run(CommandSender sender, String alias, String[] args) { // check if we have any parameters if (args.length > 0) { // check permissions and roll it :) Boolean hasPerms = true; if (sender instanceof Player) { hasPerms = Permissions.checkPerms((Player) sender, "cex.unmute"); } // permissions ok, mute the player if (hasPerms) { unmute(sender, args, "unmute", alias); } } else { // show usage Commands.showCommandHelpAndUsage(sender, "cex_unmute", alias); } return true; }