Add cosmetics unlock command for all players

This commit is contained in:
Graphica 2017-06-28 18:31:48 -04:00
parent 60f4511a79
commit 7f729ca586
1 changed files with 22 additions and 5 deletions

View File

@ -41,13 +41,30 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
{ {
addCosmetics(null, caller); addCosmetics(null, caller);
} }
else if (args.length == 1) else if (args.length >= 1)
{ {
Player player = Bukkit.getPlayer(args[0]); if (args[0].equalsIgnoreCase("all"))
if (player != null)
{ {
addCosmetics(null, player); for (Player player : UtilServer.getPlayers())
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added all the cosmetics to " + F.name(player.getName()) + "!")); {
if (player != null)
{
addCosmetics(null, player);
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added all the cosmetics to " + F.name(player.getName()) + "!"));
}
}
}
else
{
for (int i = 0; i < args.length; ++i)
{
Player player = Bukkit.getPlayer(args[i]);
if (player != null)
{
addCosmetics(null, player);
UtilPlayer.message(caller, F.main("Unlock Cosmetics", "Added all the cosmetics to " + F.name(player.getName()) + "!"));
}
}
} }
} }
} }