Add cosmetics unlock command for all players

This commit is contained in:
Graphica 2017-06-28 18:31:48 -04:00 committed by cnr
parent 36ec3014bf
commit 0495b2d1ec

View File

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