From 7966146304a7d192df4bb61638b34e10f42ed207 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Mon, 30 Mar 2020 15:19:12 +0200 Subject: [PATCH] Added %[gamemode]_visited_island_members_list% placeholder Implements https://github.com/BentoBoxWorld/BentoBox/issues/1246 --- .../bentobox/bentobox/lists/GameModePlaceholder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java index 185e85d02..fee1f9c85 100644 --- a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java +++ b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java @@ -228,6 +228,18 @@ public enum GameModePlaceholder { Optional 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 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