diff --git a/MobArena.jar b/MobArena.jar index a5ecf5b..efbdc78 100644 Binary files a/MobArena.jar and b/MobArena.jar differ diff --git a/src/com/garbagemule/MobArena/MACommands.java b/src/com/garbagemule/MobArena/MACommands.java index ea39a23..fbcf0b6 100644 --- a/src/com/garbagemule/MobArena/MACommands.java +++ b/src/com/garbagemule/MobArena/MACommands.java @@ -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; } diff --git a/src/com/garbagemule/MobArena/MAUtils.java b/src/com/garbagemule/MobArena/MAUtils.java index c54283e..7370696 100644 --- a/src/com/garbagemule/MobArena/MAUtils.java +++ b/src/com/garbagemule/MobArena/MAUtils.java @@ -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 String listToString(List 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 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();