From 5bd7830c1f0c24756948c3a45c48fdddaa4b8888 Mon Sep 17 00:00:00 2001 From: Shyanne Date: Sun, 21 Jul 2024 14:09:06 -0400 Subject: [PATCH] Update IslandPlaceholderBuilder.java (#883) fixed swapped placeholders, removed redundant placeholders, and fixed enhancement placeholder defaults `experience_rank` and `value_rank` placeholders were accidentally swapped Co-authored-by: Peaches_MLG --- .../IslandPlaceholderBuilder.java | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java b/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java index 0db905fc4..29bf92b9e 100644 --- a/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java +++ b/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java @@ -56,8 +56,8 @@ public List getPlaceholders(Island island) { new Placeholder("island_experience", String.valueOf(island.getExperience())), new Placeholder("island_experienceToLevelUp", String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getTeamExperienceForNextLevel(island))), new Placeholder("island_experienceForNextLevel", String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getExperienceForLevel(island.getLevel() + 1))), - new Placeholder("island_value_rank", () -> String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getRank(island, IridiumSkyblock.getInstance().getTop().experienceTeamSort))), - new Placeholder("island_experience_rank", () -> String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getRank(island, IridiumSkyblock.getInstance().getTop().valueTeamSort))), + new Placeholder("island_value_rank", () -> String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getRank(island, IridiumSkyblock.getInstance().getTop().valueTeamSort))), + new Placeholder("island_experience_rank", () -> String.valueOf(IridiumSkyblock.getInstance().getIslandManager().getRank(island, IridiumSkyblock.getInstance().getTop().experienceTeamSort))), new Placeholder("island_members_online", () -> String.join(", ", onlineUsers)), new Placeholder("island_members_online_count", () -> String.valueOf(onlineUsers.size())), new Placeholder("island_members_offline", () -> String.join(", ", offlineUsers)), @@ -76,9 +76,6 @@ public List getPlaceholders(Island island) { placeholderList.add(new Placeholder("island_visitors", () -> visitingPlayers.stream().map(Player::getName).collect(Collectors.joining(", ")))); placeholderList.add(new Placeholder("island_visitors_amount", () -> String.valueOf(visitingPlayers.size()))); - placeholderList.add(new Placeholder("island_visitors", () -> visitingPlayers.stream().map(Player::getName).collect(Collectors.joining(", ")))); - placeholderList.add(new Placeholder("island_visitors_amount", () -> String.valueOf(visitingPlayers.size()))); - for (Map.Entry> enhancement : IridiumSkyblock.getInstance().getEnhancementList().entrySet()) { if (!enhancement.getValue().enabled) continue; TeamEnhancement teamEnhancement = IridiumSkyblock.getInstance().getIslandManager().getTeamEnhancement(island, enhancement.getKey()); @@ -125,21 +122,11 @@ private List initializeDefaultPlaceholders() { )); for (Map.Entry> enhancement : IridiumSkyblock.getInstance().getEnhancementList().entrySet()) { - if (enhancement.getValue().type == EnhancementType.BOOSTER) { - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_active", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_level", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_hours", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_minutes", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_seconds", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - } - - if (enhancement.getValue().type == EnhancementType.UPGRADE) { - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_active", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_level", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_hours", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_minutes", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_seconds", IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); - } + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_active", () -> IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_level", () -> IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_hours", () -> IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_minutes", () -> IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_seconds", () -> IridiumSkyblock.getInstance().getMessages().nullPlaceholder)); } for (BankItem bankItem : IridiumSkyblock.getInstance().getBankItemList()) {