mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Improve PlayerTarget code (#5131)
Co-authored-by: pop4959 <pop4959@gmail.com>
This commit is contained in:
parent
767185ec32
commit
f91dfed5b4
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user