diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-12-21 17:42:55 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-12-21 17:42:55 +0000 |
commit | 40b22a11cb82ac3bec6413665fc37b3b1cc40354 (patch) | |
tree | 412712e0a3415aaa534ac259e1fdb39c6c73e3f2 | |
parent | 6c0970e4b356e011df20a3e4165f1998324b2406 (diff) | |
download | Essentials-40b22a11cb82ac3bec6413665fc37b3b1cc40354.tar Essentials-40b22a11cb82ac3bec6413665fc37b3b1cc40354.tar.gz Essentials-40b22a11cb82ac3bec6413665fc37b3b1cc40354.tar.lz Essentials-40b22a11cb82ac3bec6413665fc37b3b1cc40354.tar.xz Essentials-40b22a11cb82ac3bec6413665fc37b3b1cc40354.zip |
Add extra /home message TL params
{1} = current home count
{2} = max home count
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandhome.java | 17 |
1 files changed, 16 insertions, 1 deletions
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); |