TF-EssentialsX/Essentials/src/com/earth2me/essentials/PlayerTarget.java

28 lines
491 B
Java
Raw Normal View History

2013-06-08 20:40:02 +00:00
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;
}
}