Skip to content

Commit

Permalink
Added %[gamemode]_visited_island_members_list% placeholder
Browse files Browse the repository at this point in the history
Implements #1246
  • Loading branch information
Poslovitch committed Mar 30, 2020
1 parent d7dd37b commit 7966146
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ public enum GameModePlaceholder {
Optional<Island> visitedIsland = addon.getIslands().getIslandAt(user.getLocation());
return visitedIsland.map(value -> String.valueOf(user.getPermissionValue(addon.getPermissionPrefix() + "team.maxsize", addon.getPlugin().getIWM().getMaxTeamSize(addon.getOverWorld())))).orElse("");
}),
/**
* Returns a comma separated list of player names that are at least MEMBER on the island the player is standing on.
* @since 1.13.0
*/
VISITED_ISLAND_MEMBERS_LIST("visited_island_members_list", (addon, user, island) -> {
if (user == null || !user.isPlayer() || user.getLocation() == null) {
return "";
}
Optional<Island> visitedIsland = addon.getIslands().getIslandAt(user.getLocation());
return visitedIsland.map(value -> value.getMemberSet(RanksManager.MEMBER_RANK).stream()
.map(addon.getPlayers()::getName).collect(Collectors.joining(","))).orElse("");
}),
/**
* Returns the amount of players that are at least MEMBER on the island the player is standing on.
* @since 1.5.2
Expand Down

0 comments on commit 7966146

Please sign in to comment.