From fcff388810e15d03ea369d711d406a37917e6b80 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 27 Jul 2024 13:39:37 -0700 Subject: [PATCH] Add placeholders for trusted and coop island members #2445 --- .../bentobox/lists/GameModePlaceholder.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java index d472ba78d..5677b3c89 100644 --- a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java +++ b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholder.java @@ -125,6 +125,22 @@ public enum GameModePlaceholder { */ ISLAND_MEMBERS_LIST("island_members_list", (addon, user, island) -> island == null ? "" : island.getMemberSet(RanksManager.MEMBER_RANK).stream() .map(addon.getPlayers()::getName).collect(Collectors.joining(","))), + /** + * Returns a comma separated list of player names that are at least TRUSTED on this island. + * @since 2.4.2 + */ + ISLAND_TRUSTED_LIST("island_trusted_list", + (addon, user, island) -> island == null ? "" + : island.getMemberSet(RanksManager.TRUSTED_RANK, false).stream().map(addon.getPlayers()::getName) + .collect(Collectors.joining(","))), + /** + * Returns a comma separated list of player names that are at least COOP on this island. + * @since 2.4.2 + */ + ISLAND_COOP_LIST("island_coop_list", + (addon, user, island) -> island == null ? "" + : island.getMemberSet(RanksManager.COOP_RANK, false).stream().map(addon.getPlayers()::getName) + .collect(Collectors.joining(","))), /** * Returns the amount of players that are TRUSTED on this island. * @since 1.5.0 @@ -244,6 +260,20 @@ public enum GameModePlaceholder { VISITED_ISLAND_MEMBERS_LIST("visited_island_members_list", (addon, user, island) -> getVisitedIsland(addon, user).map(value -> value.getMemberSet(RanksManager.MEMBER_RANK).stream() .map(addon.getPlayers()::getName).collect(Collectors.joining(","))).orElse("")), + /** + * Returns a comma separated list of player names that are at TRUSTED on the island the player is standing on. + * @since 2.4.2 + */ + VISITED_ISLAND_TRUSTED_LIST("visited_island_trusted_list", (addon, user, + island) -> getVisitedIsland(addon, user).map(value -> value.getMemberSet(RanksManager.TRUSTED_RANK, false) + .stream().map(addon.getPlayers()::getName).collect(Collectors.joining(","))).orElse("")), + /** + * Returns a comma separated list of player names that are COOP on the island the player is standing on. + * @since 2.4.2 + */ + VISITED_ISLAND_COOP_LIST("visited_island_coop_list", (addon, user, + island) -> getVisitedIsland(addon, user).map(value -> value.getMemberSet(RanksManager.COOP_RANK, false) + .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