Skip to content

Commit

Permalink
Added visitors_count placeholder (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Jan 5, 2022
1 parent e2d83df commit 4e81156
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -141,6 +141,10 @@ public abstract class PlaceholderHook {
StringUtils.fancyFormat(plugin.getGrid().getTotalLevel(), superiorPlayer.getUserLocale()))
.put("nether_unlocked", (island, superiorPlayer) -> island.isNetherEnabled() ? "Yes" : "No")
.put("end_unlocked", (island, superiorPlayer) -> island.isEndEnabled() ? "Yes" : "No")
.put("visitors_count", (island, superiorPlayer) -> {
return island.getAllPlayersInside().stream().filter(visitor ->
island.isVisitor(visitor, false)).count() + "";
})
.build();

private static List<PlaceholdersProvider> placeholdersProviders;
Expand Down

0 comments on commit 4e81156

Please sign in to comment.