added new /ds stop to stop single parties, renamed old /ds stop to stopall

This commit is contained in:
Gibstick 2013-07-18 21:17:05 -04:00
parent d70eb38848
commit c988e9a723
3 changed files with 15 additions and 8 deletions

BIN
dist/DiscoSheep.jar vendored

Binary file not shown.

View File

@ -18,7 +18,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor {
private static final String PERMISSION_PARTY = "discosheep.party"; private static final String PERMISSION_PARTY = "discosheep.party";
private static final String PERMISSION_ALL = "discosheep.partyall"; private static final String PERMISSION_ALL = "discosheep.partyall";
private static final String PERMISSION_FIREWORKS = "discosheep.fireworks"; private static final String PERMISSION_FIREWORKS = "discosheep.fireworks";
private static final String PERMISSION_STOP = "discosheep.stop"; private static final String PERMISSION_STOPALL = "discosheep.stopall";
private static final String PERMISSION_RELOAD = "discosheep.reload"; private static final String PERMISSION_RELOAD = "discosheep.reload";
private static final String PERMISSION_OTHER = "discosheep.partyother"; private static final String PERMISSION_OTHER = "discosheep.partyother";
@ -110,15 +110,20 @@ public class DiscoSheepCommandExecutor implements CommandExecutor {
} }
} }
private boolean stopCommand(CommandSender sender) { private boolean stopAllCommand(CommandSender sender) {
if (senderHasPerm(sender, PERMISSION_STOP)) { if (senderHasPerm(sender, PERMISSION_STOPALL)) {
parent.stopAllParties(); parent.stopAllParties();
return true; return true;
} else { } else {
return noPermsMessage(sender, PERMISSION_STOP); return noPermsMessage(sender, PERMISSION_STOPALL);
} }
} }
private boolean stopMeCommand(CommandSender sender) {
parent.stopParty(sender.getName());
return true;
}
private boolean partySelectCommand(String[] players, CommandSender sender, int _duration, int _sheepNumber, int _radius, int _period, boolean _fireworks) { private boolean partySelectCommand(String[] players, CommandSender sender, int _duration, int _sheepNumber, int _radius, int _period, boolean _fireworks) {
if (senderHasPerm(sender, PERMISSION_OTHER)) { if (senderHasPerm(sender, PERMISSION_OTHER)) {
Player p; Player p;
@ -200,8 +205,10 @@ public class DiscoSheepCommandExecutor implements CommandExecutor {
if (args[0].equalsIgnoreCase("all")) { if (args[0].equalsIgnoreCase("all")) {
return partyAllCommand(player, duration, sheepNumber, radius, period, fireworks); return partyAllCommand(player, duration, sheepNumber, radius, period, fireworks);
} else if (args[0].equalsIgnoreCase("stop")) { } else if (args[0].equalsIgnoreCase("stopall")) {
return stopCommand(sender); return stopAllCommand(sender);
} else if (args[0].equalsIgnoreCase("stop") && isPlayer) {
return stopMeCommand(sender);
} else if (args[0].equalsIgnoreCase("me") && isPlayer) { } else if (args[0].equalsIgnoreCase("me") && isPlayer) {
return partyCommand(player, duration, sheepNumber, radius, period, fireworks); return partyCommand(player, duration, sheepNumber, radius, period, fireworks);
} else if (args[0].equalsIgnoreCase("other")) { } else if (args[0].equalsIgnoreCase("other")) {

View File

@ -16,7 +16,7 @@ permissions:
discosheep.party: true discosheep.party: true
discosheep.partyall: true discosheep.partyall: true
discosheep.fireworks: true discosheep.fireworks: true
discosheep.stop: true discosheep.stopall: true
discosheep.reload: true discosheep.reload: true
discosheep.party: discosheep.party:
description: Allows a player to have a party of one description: Allows a player to have a party of one
@ -24,7 +24,7 @@ permissions:
discosheep.partyall: discosheep.partyall:
description: Allows a player to call a server-wide party description: Allows a player to call a server-wide party
default: op default: op
discosheep.stop: discosheep.stopall:
description: Allows a player to stop all parties on the server description: Allows a player to stop all parties on the server
default: op default: op
discosheep.fireworks: discosheep.fireworks: