mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-01-29 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String list = MAUtils.playerListToString(arena.getLivingPlayers());
|
String list = MAUtils.listToString(arena.getLivingPlayers());
|
||||||
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
|
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
StringBuffer buffy = new StringBuffer();
|
StringBuffer buffy = new StringBuffer();
|
||||||
for (Arena arena : am.arenas)
|
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()));
|
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, buffy.toString()));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -351,7 +351,7 @@ public class MACommands implements CommandExecutor
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String list = MAUtils.playerListToString(arena.getNonreadyPlayers());
|
String list = MAUtils.listToString(arena.getNonreadyPlayers());
|
||||||
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
|
MAUtils.tellPlayer(sender, MAMessages.get(Msg.MISC_LIST_PLAYERS, list));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -449,6 +449,9 @@ public class MAUtils
|
|||||||
|
|
||||||
for (ItemStack stack : stacks)
|
for (ItemStack stack : stacks)
|
||||||
{
|
{
|
||||||
|
if (stack == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
// If these are rewards, don't tamper with them.
|
// If these are rewards, don't tamper with them.
|
||||||
if (rewards)
|
if (rewards)
|
||||||
{
|
{
|
||||||
@ -870,6 +873,7 @@ public class MAUtils
|
|||||||
*/
|
*/
|
||||||
public static <E> String listToString(List<E> list)
|
public static <E> String listToString(List<E> list)
|
||||||
{
|
{
|
||||||
|
System.out.println(list.getClass());
|
||||||
return listToString(list, true);
|
return listToString(list, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -881,21 +885,7 @@ public class MAUtils
|
|||||||
StringBuffer buffy = new StringBuffer();
|
StringBuffer buffy = new StringBuffer();
|
||||||
for (E e : list)
|
for (E e : list)
|
||||||
{
|
{
|
||||||
buffy.append(e.toString());
|
buffy.append((e instanceof Player) ? ((Player) e).getName() : 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(" ");
|
buffy.append(" ");
|
||||||
}
|
}
|
||||||
return buffy.toString();
|
return buffy.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user