diff --git a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java index d56a8b1..fca8241 100644 --- a/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java +++ b/src/gibstick/bukkit/discosheep/DiscoSheepCommandExecutor.java @@ -1,5 +1,6 @@ package gibstick.bukkit.discosheep; +import org.bukkit.Bukkit; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.CommandExecutor; @@ -15,8 +16,22 @@ public class DiscoSheepCommandExecutor implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player) { - parent.startParty((Player)sender); + if (args.length == 1) { + if ("all".equals(args[0])) { + for (Player player : Bukkit.getServer().getOnlinePlayers()) { + parent.startParty(player); + } + } + else if ("stop".equals(args[0])) { + parent.stopAllParties(); + } else { + sender.sendMessage("Invalid argument."); + return true; + } + } else { + if (sender instanceof Player) { + parent.startParty((Player) sender); + } } return true; }