Skip to content

Commit

Permalink
Bug fixes with /list
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyyid committed Feb 22, 2016
1 parent cc180c1 commit 0b11fac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {

group = "io.github.hsyyid"
archivesBaseName = "EssentialCmds"
version = '7.5c'
version = '7.5d'

apply plugin: 'net.ellune.blossom'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public CommandResult execute(CommandSource src, CommandContext ctx) throws Comma
if (optPermissionService.isPresent())
{
PermissionService permissionService = optPermissionService.get();
List<UUID> listedPlayers = Lists.newArrayList();

for (Subject group : permissionService.getGroupSubjects().getAllSubjects())
{
Expand All @@ -69,11 +68,19 @@ public CommandResult execute(CommandSource src, CommandContext ctx) throws Comma
while (itr.hasNext())
{
Subject user = itr.next();
Optional<Player> optPlayer = Sponge.getServer().getPlayer(UUID.fromString(user.getIdentifier()));
Optional<Player> optPlayer = Optional.empty();

if (optPlayer.isPresent() && !listedPlayers.contains(optPlayer.get().getUniqueId()))
try
{
optPlayer = Sponge.getServer().getPlayer(UUID.fromString(user.getIdentifier()));
}
catch (IllegalArgumentException e)
{
optPlayer = Sponge.getServer().getPlayer(user.getIdentifier());
}

if (optPlayer.isPresent())
{
listedPlayers.add(optPlayer.get().getUniqueId());
onlineUsers.add(optPlayer.get().getName());
}
}
Expand Down

0 comments on commit 0b11fac

Please sign in to comment.