diff options
author | ementalo <ementalo@gmx.co.uk> | 2011-06-28 10:10:29 +0100 |
---|---|---|
committer | ementalo <ementalo@gmx.co.uk> | 2011-06-28 10:10:29 +0100 |
commit | b6a6b7192f7c03651e80ccca07af90a0e602bb67 (patch) | |
tree | 09d1f4a3e5aa2ebce61108def46e341123cdf695 | |
parent | 1a17c9ea8dee101caabfc1523ddb60fd06ad0455 (diff) | |
download | Essentials-b6a6b7192f7c03651e80ccca07af90a0e602bb67.tar Essentials-b6a6b7192f7c03651e80ccca07af90a0e602bb67.tar.gz Essentials-b6a6b7192f7c03651e80ccca07af90a0e602bb67.tar.lz Essentials-b6a6b7192f7c03651e80ccca07af90a0e602bb67.tar.xz Essentials-b6a6b7192f7c03651e80ccca07af90a0e602bb67.zip |
admin can set others homes. needs "essentials.sethome.others" permission
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandsethome.java | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java index fcd451dd4..531bcc26b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java @@ -11,12 +11,28 @@ public class Commandsethome extends EssentialsCommand { super("sethome"); } - + @Override public void run(Server server, User user, String commandLabel, String[] args) throws Exception { - user.setHome(args.length > 0 && args[0].equalsIgnoreCase("default")); - charge(user); - user.sendMessage(Util.i18n("homeSet")); + if (args.length > 0) + { + if (args.length < 2) + { + user.setHome(args[0].equalsIgnoreCase("default")); + } + else + { + if (user.isAuthorized("essentials.sethome.others")) + { + User usersHome = ess.getUser(ess.getServer().getPlayer(args[0])); + usersHome.setHome(args[1].equalsIgnoreCase("default")); + } + } + charge(user); + user.sendMessage(Util.i18n("homeSet")); + } + + } } |