Add extra /home message TL params

{1} = current home count
{2} = max home count
This commit is contained in:
KHobbits 2013-12-21 17:42:55 +00:00
parent b6b2ee61a4
commit bcd5350a4d

View file

@ -18,6 +18,7 @@ public class Commandhome extends EssentialsCommand
super("home"); super("home");
} }
// This method contains an undocumented translation parameters #EasterEgg
@Override @Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception 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 else
{ {
final int count = homes.size();
if (user.isAuthorized("essentials.home.bed")) if (user.isAuthorized("essentials.home.bed"))
{ {
if (bed != null) if (bed != null)
@ -87,12 +89,25 @@ public class Commandhome extends EssentialsCommand
homes.add(_("bedNull")); homes.add(_("bedNull"));
} }
} }
user.sendMessage(_("homes", StringUtil.joinList(homes))); user.sendMessage(_("homes", StringUtil.joinList(homes), count, getHomeLimit(player)));
} }
} }
throw new NoChargeException(); 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 private void goHome(final User user, final User player, final String home, final Trade charge) throws Exception
{ {
final Location loc = player.getHome(home); final Location loc = player.getHome(home);