Stop using old string player lookup.

This commit is contained in:
KHobbits 2014-05-17 02:44:37 +01:00
parent 8e7abe325e
commit cbaf126a25
3 changed files with 9 additions and 8 deletions

View file

@ -10,6 +10,7 @@ import com.earth2me.essentials.utils.NumberUtil;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IEssentials;
@ -28,7 +29,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
{
private static final Logger logger = Logger.getLogger("Essentials");
private CommandSource replyTo = null;
private transient String teleportRequester;
private transient UUID teleportRequester;
private transient boolean teleportRequestHere;
private transient Location teleportLocation;
private transient boolean vanished;
@ -265,7 +266,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
public void requestTeleport(final User player, final boolean here)
{
teleportRequestTime = System.currentTimeMillis();
teleportRequester = player == null ? null : player.getName();
teleportRequester = player == null ? null : player.getBase().getUniqueId();
teleportRequestHere = here;
if (player == null)
{
@ -277,7 +278,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
}
}
public String getTeleportRequest()
public UUID getTeleportRequest()
{
return teleportRequester;
}

View file

@ -47,13 +47,13 @@ public class Commandmail extends EssentialsCommand
{
throw new Exception(tl("noPerm", "essentials.mail.send"));
}
if (user.isMuted())
{
throw new Exception(tl("voiceSilenced"));
}
User u = ess.getUser(args[1]);
User u = getPlayer(server, args[1], true, true);
if (u == null)
{
throw new Exception(tl("playerNeverOnServer", args[1]));
@ -112,7 +112,7 @@ public class Commandmail extends EssentialsCommand
}
else if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{
User u = ess.getUser(args[1]);
User u = getPlayer(server, args[1], true, true);
if (u == null)
{
throw new Exception(tl("playerNeverOnServer", args[1]));
@ -130,7 +130,7 @@ public class Commandmail extends EssentialsCommand
else if (args.length >= 2)
{
//allow sending from console without "send" argument, since it's the only thing the console can do
User u = ess.getUser(args[0]);
User u = getPlayer(server, args[0], true, true);
if (u == null)
{
throw new Exception(tl("playerNeverOnServer", args[0]));

View file

@ -40,7 +40,7 @@ public class Commandsethome extends EssentialsCommand
name = args[1].toLowerCase(Locale.ENGLISH);
if (user.isAuthorized("essentials.sethome.others"))
{
usersHome = ess.getUser(args[0]);
usersHome = getPlayer(server, args[0], true, true);
if (usersHome == null)
{
throw new PlayerNotFoundException();