summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-05-17 02:44:37 +0100
committerKHobbits <rob@khobbits.co.uk>2014-05-17 02:47:10 +0100
commit77b06c39a3cdc841931d41f0ce5c526073bc21f8 (patch)
tree4053ca46e1844b513dce1848df5066b21f70223f
parent8964d38c3e1bddfa1ae9f76b889cfce37409d24b (diff)
downloadEssentials-77b06c39a3cdc841931d41f0ce5c526073bc21f8.tar
Essentials-77b06c39a3cdc841931d41f0ce5c526073bc21f8.tar.gz
Essentials-77b06c39a3cdc841931d41f0ce5c526073bc21f8.tar.lz
Essentials-77b06c39a3cdc841931d41f0ce5c526073bc21f8.tar.xz
Essentials-77b06c39a3cdc841931d41f0ce5c526073bc21f8.zip
Stop using old string player lookup.
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandmail.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandsethome.java2
3 files changed, 9 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 0146da74a..8ca3e18cc 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -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;
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
index 0b7a5a09d..70ea2f5d9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java
@@ -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]));
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
index 15f10e786..6a432d660 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandsethome.java
@@ -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();