mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 03:25:50 +00:00
/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
This commit is contained in:
parent
e50cb7d86a
commit
86dce6e092
1 changed files with 14 additions and 1 deletions
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
|
import com.earth2me.essentials.Util;
|
||||||
|
|
||||||
|
|
||||||
public class Commandhome extends EssentialsCommand
|
public class Commandhome extends EssentialsCommand
|
||||||
|
@ -17,7 +18,19 @@ public class Commandhome extends EssentialsCommand
|
||||||
user.canAfford(this);
|
user.canAfford(this);
|
||||||
if(args.length > 0 && user.isAuthorized("essentials.home.others"))
|
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());
|
user.getTeleport().home(u, this.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue