diff --git a/Essentials/src/main/java/com/earth2me/essentials/PlayerTarget.java b/Essentials/src/main/java/com/earth2me/essentials/PlayerTarget.java index e13b1cb25..0804bd55d 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/PlayerTarget.java +++ b/Essentials/src/main/java/com/earth2me/essentials/PlayerTarget.java @@ -4,15 +4,17 @@ import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; +import java.util.UUID; + public class PlayerTarget implements ITarget { - private final String name; + private final UUID uuid; public PlayerTarget(final Player entity) { - this.name = entity.getName(); + this.uuid = entity.getUniqueId(); } @Override public Location getLocation() { - return Bukkit.getServer().getPlayerExact(name).getLocation(); + return Bukkit.getPlayer(uuid).getLocation(); } }