Skip to content

Commit

Permalink
Fix issue when Has_Island option in UserList did not show players if …
Browse files Browse the repository at this point in the history
…they have not done any challenge.
  • Loading branch information
BONNe committed Jan 23, 2019
1 parent 2220526 commit d3bf5a1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import world.bentobox.bentobox.api.panels.PanelItem;
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Players;
import world.bentobox.challenges.ChallengesAddon;
import world.bentobox.challenges.ChallengesManager;
import world.bentobox.challenges.panel.CommonGUI;
Expand Down Expand Up @@ -235,7 +236,10 @@ private List<Player> collectUsers(ViewMode mode)
}
else if (mode.equals(ViewMode.WITH_ISLAND))
{
return this.addon.getChallengesManager().getPlayers(this.world);
return this.addon.getPlayers().getPlayers().stream().
filter(player -> this.addon.getIslands().getIsland(this.world, player.getPlayerUUID()) != null).
map(Players::getPlayer).
collect(Collectors.toList());
}
else
{
Expand Down

0 comments on commit d3bf5a1

Please sign in to comment.