From 81cca6adc896c5ec2ac93932d9e90fc607c50b05 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Mon, 8 Apr 2019 20:47:45 +0200 Subject: [PATCH] Added %[gamemode]_world_islands% and %[gamemode]_rank% placeholders #621 --- .../bentobox/bentobox/lists/GameModePlaceholders.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholders.java b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholders.java index a8f2fc482..17fd1ae06 100644 --- a/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholders.java +++ b/src/main/java/world/bentobox/bentobox/lists/GameModePlaceholders.java @@ -11,6 +11,11 @@ public enum GameModePlaceholders { /* World-related */ WORLD_FRIENDLY_NAME("world_friendly_name", (addon, user, island) -> addon.getWorldSettings().getFriendlyName()), + /** + * Displays the amount of islands in the world. + * @since 1.5.0 + */ + WORLD_ISLANDS("world_islands", (addon, user, island) -> String.valueOf(addon.getIslands().getIslandCount(addon.getOverWorld()))), /* Island-related */ ISLAND_DISTANCE("island_distance", (addon, user, island) -> island == null ? "" : DateFormat.getInstance().format(Date.from(Instant.ofEpochMilli(island.getCreatedDate())))), @@ -46,6 +51,11 @@ public enum GameModePlaceholders { * @since 1.5.0 */ HAS_ISLAND("has_island", (addon, user, island) -> String.valueOf(island != null)), + /** + * Displays the rank this player has on his island. + * @since 1.5.0 + */ + RANK("rank", (addon, user, island) -> (island == null || user == null) ? "" : addon.getPlugin().getLocalesManager().get(user, addon.getPlugin().getRanksManager().getRank(island.getRank(user)))), /** * Displays how many times this player reset his island. * @since 1.5.0