diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-05-07 00:05:02 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-05-07 00:05:02 +0100 |
commit | cd1734f0965652fef584df42f79a22a8f42387db (patch) | |
tree | a8202ec04f608ac1caa056a667e0634fd0ebfaaf /Essentials/src/com/earth2me/essentials/commands/Commandsethome.java | |
parent | 86fed7df38ec514c19688c059c9c1017cbc1e8b8 (diff) | |
download | Essentials-cd1734f0965652fef584df42f79a22a8f42387db.tar Essentials-cd1734f0965652fef584df42f79a22a8f42387db.tar.gz Essentials-cd1734f0965652fef584df42f79a22a8f42387db.tar.lz Essentials-cd1734f0965652fef584df42f79a22a8f42387db.tar.xz Essentials-cd1734f0965652fef584df42f79a22a8f42387db.zip |
Update home count to include the bed home if set, this does not prevent people from setting a bed home if they are at max.
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandsethome.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsethome.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index d59ac4a31..a4bdb08ad 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -29,10 +29,11 @@ public class Commandsethome extends EssentialsCommand { if (user.isAuthorized("essentials.sethome.multiple")) { - if ("bed".equals(args[0].toLowerCase(Locale.ENGLISH))) { + if ("bed".equals(args[0].toLowerCase(Locale.ENGLISH))) + { throw new NotEnoughArgumentsException(); } - if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomes().size() < ess.getSettings().getHomeLimit(user)) + if ((user.isAuthorized("essentials.sethome.multiple.unlimited")) || (user.getHomeCount() < ess.getSettings().getHomeLimit(user)) || (user.getHomes().contains(args[0].toLowerCase(Locale.ENGLISH)))) { user.setHome(args[0].toLowerCase(Locale.ENGLISH)); @@ -66,7 +67,8 @@ public class Commandsethome extends EssentialsCommand { name = "home"; } - if ("bed".equals(name.toLowerCase(Locale.ENGLISH))) { + if ("bed".equals(name.toLowerCase(Locale.ENGLISH))) + { throw new NotEnoughArgumentsException(); } usersHome.setHome(name, user.getLocation()); |