Allow different 'sets' of multiple homes, definable by permission.

- Not sure I like this, but it does seem to work
- changed config key for backwards compatibility (config node sets value on failure).
This commit is contained in:
KHobbits 2011-10-01 10:08:58 +01:00
parent 629dee3a91
commit ea76161ba5
4 changed files with 115 additions and 45 deletions

View file

@ -28,14 +28,14 @@ public class Commandsethome extends EssentialsCommand
{
if (user.isAuthorized("essentials.sethome.multiple"))
{
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getMultipleHomes())
if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user))
|| (user.getHomes().contains(args[0].toLowerCase())))
{
user.setHome(args[0].toLowerCase());
}
else
{
throw new Exception(Util.format("maxHomes", ess.getSettings().getMultipleHomes()));
throw new Exception(Util.format("maxHomes", ess.getSettings().getHomeLimit(user)));
}
}