Fix max home locale placeholder, account for free homes, fix #338

This commit is contained in:
William committed 2023-04-03 11:53:02 +01:00
1 parent e81509a978
commit a877984342
5 files changed
+38 -31

No files matched your search

@@ -45,18 +45,9 @@ public class PlaceholderAPIHook extends Hook {
case "homes_count" -> String.valueOf(plugin.getManager().homes()
.getUserHomes()
.getOrDefault(player.getUsername(), List.of()).size());
case "max_homes" -> String.valueOf(player.getMaxHomes(
plugin.getSettings().getMaxHomes(),
plugin.getSettings().doStackPermissionLimits()
));
case "max_public_homes" -> String.valueOf(player.getMaxPublicHomes(
plugin.getSettings().getMaxPublicHomes(),
plugin.getSettings().doStackPermissionLimits()
));
case "free_home_slots" -> String.valueOf(player.getFreeHomes(
plugin.getSettings().getFreeHomeSlots(),
plugin.getSettings().doStackPermissionLimits()
));
case "max_homes" -> String.valueOf(plugin.getManager().homes().getMaxHomes(player));
case "max_public_homes" -> String.valueOf(plugin.getManager().homes().getMaxPublicHomes(player));
case "free_home_slots" -> String.valueOf(plugin.getManager().homes().getFreeHomes(player));
case "home_slots" -> String.valueOf(plugin.getSavedUser(player)
.map(SavedUser::getHomeSlots)
.orElse(0));