mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-01-13 11:41:28 +01:00
Added a check to giveItems
This commit is contained in:
parent
f36b7e6628
commit
8ade85e0c9
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user