Add cosmetics unlock command for all players
This commit is contained in:
parent
60f4511a79
commit
7f729ca586
@ -41,9 +41,12 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
|
|||||||
{
|
{
|
||||||
addCosmetics(null, caller);
|
addCosmetics(null, caller);
|
||||||
}
|
}
|
||||||
else if (args.length == 1)
|
else if (args.length >= 1)
|
||||||
|
{
|
||||||
|
if (args[0].equalsIgnoreCase("all"))
|
||||||
|
{
|
||||||
|
for (Player player : UtilServer.getPlayers())
|
||||||
{
|
{
|
||||||
Player player = Bukkit.getPlayer(args[0]);
|
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
addCosmetics(null, player);
|
addCosmetics(null, player);
|
||||||
@ -51,6 +54,20 @@ public class UnlockCosmeticsCommand extends CommandBase<GadgetManager>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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()) + "!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void addCosmetics(GadgetType gadgetType, Player caller)
|
private void addCosmetics(GadgetType gadgetType, Player caller)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user