mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-03 19:00:30 +02:00
Spaces, formatting.
This commit is contained in:
parent
7ab21d9e72
commit
25e1e392a0
|
@ -23,10 +23,11 @@ public class ExemptCommand extends BaseCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command,
|
||||
String label, String[] args) {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
// TODO: Reduce copy and paste by introducing some super class.
|
||||
if (args.length < 2 || args.length > 3) return false;
|
||||
if (args.length < 2 || args.length > 3) {
|
||||
return false;
|
||||
}
|
||||
String playerName = args[1];
|
||||
final CheckType checkType;
|
||||
if (args.length == 3){
|
||||
|
@ -38,14 +39,18 @@ public class ExemptCommand extends BaseCommand {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
else checkType = CheckType.ALL;
|
||||
else {
|
||||
checkType = CheckType.ALL;
|
||||
}
|
||||
|
||||
final Player player = DataManager.getPlayer(playerName);
|
||||
if (player == null){
|
||||
sender.sendMessage(TAG + "Player not online: " + playerName);
|
||||
return true;
|
||||
}
|
||||
else playerName = player.getName();
|
||||
else {
|
||||
playerName = player.getName();
|
||||
}
|
||||
NCPExemptionManager.exemptPermanently(player, checkType);
|
||||
sender.sendMessage(TAG + "Player " + playerName + " is now exempted from: " + checkType);
|
||||
return true;
|
||||
|
@ -55,7 +60,9 @@ public class ExemptCommand extends BaseCommand {
|
|||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
// At least complete CheckType
|
||||
if (args.length == 3) return CommandUtil.getCheckTypeTabMatches(args[2]);
|
||||
if (args.length == 3) {
|
||||
return CommandUtil.getCheckTypeTabMatches(args[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user