From bcd5350a4df65a548651735be2cea8c883b5c698 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 21 Dec 2013 17:42:55 +0000 Subject: Add extra /home message TL params {1} = current home count {2} = max home count --- .../com/earth2me/essentials/commands/Commandhome.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index f204c0a49..3d9200cbd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -18,6 +18,7 @@ public class Commandhome extends EssentialsCommand super("home"); } + // This method contains an undocumented translation parameters #EasterEgg @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { @@ -76,6 +77,7 @@ public class Commandhome extends EssentialsCommand } else { + final int count = homes.size(); if (user.isAuthorized("essentials.home.bed")) { if (bed != null) @@ -87,12 +89,25 @@ public class Commandhome extends EssentialsCommand homes.add(_("bedNull")); } } - user.sendMessage(_("homes", StringUtil.joinList(homes))); + user.sendMessage(_("homes", StringUtil.joinList(homes), count, getHomeLimit(player))); } } throw new NoChargeException(); } + private String getHomeLimit(final User player) + { + if (!player.isOnline()) + { + return "?"; + } + if (player.isAuthorized("essentials.sethome.multiple.unlimited")) + { + return "*"; + } + return Integer.toString(ess.getSettings().getHomeLimit(player)); + } + private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception { final Location loc = player.getHome(home); -- cgit v1.2.3