Invert this check for clarity's sake.

This commit is contained in:
GJ 2013-02-08 11:12:32 -05:00
parent ae3a95dd34
commit ef5f72f56c

View File

@ -17,6 +17,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.party.PartyManager;
import com.gmail.nossr50.party.ShareHandler;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users;
public class PartyCommand implements CommandExecutor {
@ -34,7 +35,8 @@ public class PartyCommand implements CommandExecutor {
return true;
}
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.party")) {
if (!Permissions.hasPermission(sender, "mcmmo.commands.party")) {
sender.sendMessage(command.getPermissionMessage());
return true;
}
@ -58,7 +60,11 @@ public class PartyCommand implements CommandExecutor {
return printHelp();
}
if (mcMMOPlayer.inParty()) {
if (!mcMMOPlayer.inParty()) {
sender.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return printUsage();
}
if (args[0].equalsIgnoreCase("quit") || args[0].equalsIgnoreCase("q") || args[0].equalsIgnoreCase("leave")) {
return partyQuitCommand.onCommand(sender, command, label, args);
}
@ -97,10 +103,6 @@ public class PartyCommand implements CommandExecutor {
}
}
player.sendMessage(LocaleLoader.getString("Commands.Party.None"));
return printUsage();
}
private boolean printUsage() {
player.sendMessage(LocaleLoader.getString("Party.Help.0"));
player.sendMessage(LocaleLoader.getString("Party.Help.1"));