diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-15 02:39:59 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-15 02:39:59 +0000 |
commit | e78ed3ad5d3e47bad368c3a069a17fa064b48d3d (patch) | |
tree | b354dc9f3baaa267e0b73c9e9c1ea0c667499134 | |
parent | b691348223e45d12da99f740377eed053de3f05e (diff) | |
download | Essentials-e78ed3ad5d3e47bad368c3a069a17fa064b48d3d.tar Essentials-e78ed3ad5d3e47bad368c3a069a17fa064b48d3d.tar.gz Essentials-e78ed3ad5d3e47bad368c3a069a17fa064b48d3d.tar.lz Essentials-e78ed3ad5d3e47bad368c3a069a17fa064b48d3d.tar.xz Essentials-e78ed3ad5d3e47bad368c3a069a17fa064b48d3d.zip |
/home: Allows to go to offline players home.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1473 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandhome.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java index 77fc32840..f82b12421 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhome.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhome.java @@ -2,6 +2,7 @@ package com.earth2me.essentials.commands; import org.bukkit.Server; import com.earth2me.essentials.User; +import com.earth2me.essentials.Util; public class Commandhome extends EssentialsCommand @@ -17,7 +18,19 @@ public class Commandhome extends EssentialsCommand user.canAfford(this); if(args.length > 0 && user.isAuthorized("essentials.home.others")) { - User u = getPlayer(server, args, 0); + User u; + try + { + u = getPlayer(server, args, 0); + } + catch(NoSuchFieldException ex) + { + u = ess.getOfflineUser(args[0]); + } + if (u == null) + { + throw new Exception(Util.i18n("playerNotFound")); + } user.getTeleport().home(u, this.getName()); return; } |