From a597a7d281c149b08116cb08f6ac2539b5e0373f Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 11 Feb 2013 15:24:20 -0500 Subject: [PATCH] Add usage string. --- .../party/commands/PartyDisbandCommand.java | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java b/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java index 839ca7370..4752d38ec 100644 --- a/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java +++ b/src/main/java/com/gmail/nossr50/party/commands/PartyDisbandCommand.java @@ -23,25 +23,33 @@ public class PartyDisbandCommand implements CommandExecutor { return true; } - player = (Player) sender; - playerParty = Users.getPlayer(player).getParty(); + switch (args.length) { + case 1: + player = (Player) sender; + playerParty = Users.getPlayer(player).getParty(); - if (!playerParty.getLeader().equals(player.getName())) { - sender.sendMessage(LocaleLoader.getString("Party.NotOwner")); - return true; - } - - for (Player member : playerParty.getOnlineMembers()) { - if (!PartyManager.handlePartyChangeEvent(member, playerParty.getName(), null, EventReason.KICKED_FROM_PARTY)) { + if (!playerParty.getLeader().equals(player.getName())) { + sender.sendMessage(LocaleLoader.getString("Party.NotOwner")); return true; } - member.sendMessage(LocaleLoader.getString("Party.Disband")); + for (Player member : playerParty.getOnlineMembers()) { + if (!PartyManager.handlePartyChangeEvent(member, playerParty.getName(), null, EventReason.KICKED_FROM_PARTY)) { + return true; + } + + member.sendMessage(LocaleLoader.getString("Party.Disband")); + } + + PartyManager.disbandParty(playerParty); + return true; + + default: + sender.sendMessage(LocaleLoader.getString("Commands.Usage.1", "party", "disband")); + return true; } - PartyManager.disbandParty(playerParty); - return true; - + } }