1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-08 07:36:42 +02:00

Restore getUser API

This commit is contained in:
KHobbits
2013-10-17 23:55:42 +01:00
parent 10167b3e95
commit dbebbbaa0e
3 changed files with 21 additions and 4 deletions

View File

@@ -610,11 +610,25 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
this.metrics = metrics;
}
@Deprecated
@Override
public User getUser(final Object base)
{
if (base instanceof Player)
{
return getUser((Player)base);
}
if (base instanceof String)
{
return getOfflineUser((String)base);
}
return null;
}
@Override
public User getUser(final String base)
{
return getOfflineUser((String)base);
{
return getOfflineUser((String)base);
}
@Override

View File

@@ -24,6 +24,9 @@ public interface IEssentials extends Plugin
boolean onCommandEssentials(CommandSender sender, Command command, String commandLabel, String[] args, ClassLoader classLoader, String commandPath, String permissionPrefix, IEssentialsModule module);
@Deprecated
User getUser(Object base);
User getUser(String base);
User getUser(Player base);

View File

@@ -44,9 +44,9 @@ public class Commandr extends EssentialsCommand
}
final CommandSource target = replyTo.getReplyTo();
final String targetName = target instanceof Player ? ((Player)target).getDisplayName() : Console.NAME;
final String targetName = target.isPlayer() ? target.getPlayer().getDisplayName() : Console.NAME;
if (target == null || ((target instanceof Player) && !((Player)target).isOnline()))
if (target == null || (target.isPlayer() && !target.getPlayer().isOnline()))
{
throw new Exception(_("foreverAlone"));
}