mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-03 22:11:42 +01:00
Restore getUser API
This commit is contained in:
parent
6f85761f7f
commit
be31b1695d
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user