mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-12 13:19:33 +00:00
28 lines
491 B
Java
28 lines
491 B
Java
![]() |
package com.earth2me.essentials;
|
||
|
|
||
|
import org.bukkit.Bukkit;
|
||
|
import org.bukkit.Location;
|
||
|
import org.bukkit.entity.Player;
|
||
|
|
||
|
|
||
|
public class PlayerTarget implements ITarget
|
||
|
{
|
||
|
private final Location location;
|
||
|
private final String name;
|
||
|
|
||
|
PlayerTarget(Player entity)
|
||
|
{
|
||
|
this.name = entity.getName();
|
||
|
this.location = null;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Location getLocation()
|
||
|
{
|
||
|
if (this.name != null)
|
||
|
{
|
||
|
return Bukkit.getServer().getPlayerExact(name).getLocation();
|
||
|
}
|
||
|
return location;
|
||
|
}
|
||
|
}
|