diff --git a/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java b/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java index 4d263cc22..dc375931f 100644 --- a/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java +++ b/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java @@ -36,7 +36,7 @@ public List getPlaceholders(Island island) { for(User user : users) { if(user.getPlayer() != null) onlineUsers.add(user.getName()); - offlineUsers.add(user.getName()); + else offlineUsers.add(user.getName()); } List placeholderList = new ArrayList<>(Arrays.asList( @@ -74,23 +74,14 @@ public List getPlaceholders(Island island) { 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()); - if(enhancement.getValue().enabled && enhancement.getValue().type == EnhancementType.BOOSTER) { - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_active", () -> String.valueOf(teamEnhancement.isActive()))); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_level", () -> String.valueOf(teamEnhancement.getLevel()))); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_hours", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() % 60), 0)))); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_minutes", () -> String.valueOf(Math.max((int) ((teamEnhancement.getRemainingTime() % 3600) / 60), 0)))); - placeholderList.add(new Placeholder("island_booster_" + enhancement.getKey() + "_time_seconds", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() / 3600), 0)))); - } - - if(enhancement.getValue().enabled && enhancement.getValue().type == EnhancementType.UPGRADE) { - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_active", () -> String.valueOf(teamEnhancement.isActive()))); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_level", () -> String.valueOf(teamEnhancement.getLevel()))); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_hours", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() % 60), 0)))); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_minutes", () -> String.valueOf(Math.max((int) ((teamEnhancement.getRemainingTime() % 3600) / 60), 0)))); - placeholderList.add(new Placeholder("island_upgrade_" + enhancement.getKey() + "_time_seconds", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() / 3600), 0)))); - } + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_active", () -> String.valueOf(teamEnhancement.isActive()))); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_level", () -> String.valueOf(teamEnhancement.getLevel()))); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_hours", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() % 60), 0)))); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_minutes", () -> String.valueOf(Math.max((int) ((teamEnhancement.getRemainingTime() % 3600) / 60), 0)))); + placeholderList.add(new Placeholder("island_enhancement_" + enhancement.getKey() + "_time_seconds", () -> String.valueOf(Math.max((int) (teamEnhancement.getRemainingTime() / 3600), 0)))); } for (BankItem bankItem : IridiumSkyblock.getInstance().getBankItemList()) {