/ds all and /ds stop commands implemented
This commit is contained in:
parent
5419d97426
commit
e4a7eed814
@ -1,5 +1,6 @@
|
|||||||
package gibstick.bukkit.discosheep;
|
package gibstick.bukkit.discosheep;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
@ -15,8 +16,22 @@ public class DiscoSheepCommandExecutor implements CommandExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||||
if (sender instanceof Player) {
|
if (args.length == 1) {
|
||||||
parent.startParty((Player)sender);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user