Added a check to giveItems

This commit is contained in:
Garbage Mule 2011-07-05 19:30:03 +02:00
parent f36b7e6628
commit 8ade85e0c9
3 changed files with 9 additions and 19 deletions

Binary file not shown.

View File

@ -308,14 +308,14 @@ public class MACommands implements CommandExecutor
return true;
}
String list = MAUtils.playerListToString(arena.getLivingPlayers());
String list = MAUtils.listToString(arena.getLivingPlayers());
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
}
else
{
StringBuffer buffy = new StringBuffer();
for (Arena arena : am.arenas)
buffy.append(MAUtils.playerListToString(arena.getLivingPlayers()));
buffy.append(MAUtils.listToString(arena.getLivingPlayers()));
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, buffy.toString()));
}
return true;
@ -351,7 +351,7 @@ public class MACommands implements CommandExecutor
return true;
}
String list = MAUtils.playerListToString(arena.getNonreadyPlayers());
String list = MAUtils.listToString(arena.getNonreadyPlayers());
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
return true;
}

View File

@ -449,6 +449,9 @@ public class MAUtils
for (ItemStack stack : stacks)
{
if (stack == null)
continue;
// If these are rewards, don't tamper with them.
if (rewards)
{
@ -869,7 +872,8 @@ public class MAUtils
* Turn a list into a space-separated string-representation of the list.
*/
public static <E> String listToString(List<E> list)
{
{
System.out.println(list.getClass());
return listToString(list, true);
}
@ -881,21 +885,7 @@ public class MAUtils
StringBuffer buffy = new StringBuffer();
for (E e : list)
{
buffy.append(e.toString());
buffy.append(" ");
}
return buffy.toString();
}
public static String playerListToString(List<Player> list)
{
if (list.isEmpty())
return MAMessages.get(Msg.MISC_NONE);
StringBuffer buffy = new StringBuffer();
for (Player p : list)
{
buffy.append(p.getName());
buffy.append((e instanceof Player) ? ((Player) e).getName() : e.toString());
buffy.append(" ");
}
return buffy.toString();