Add LivingEntity#getTargetEntity

This commit is contained in:
BillyGalbreath
2018-09-22 00:32:53 -05:00
parent 63821bf96b
commit 51b4b8a059
2 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package com.destroystokyo.paper.entity;
import org.bukkit.entity.Entity;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
/**
* Represents information about a targeted entity
* @deprecated use {@link org.bukkit.util.RayTraceResult}
*/
@Deprecated(forRemoval = true, since = "1.19.3")
public class TargetEntityInfo {
private final Entity entity;
private final Vector hitVec;
public TargetEntityInfo(@NotNull Entity entity, @NotNull Vector hitVec) {
this.entity = entity;
this.hitVec = hitVec;
}
/**
* Get the entity that is targeted
*
* @return Targeted entity
*/
@NotNull
public Entity getEntity() {
return entity;
}
/**
* Get the position the entity is targeted at
*
* @return Targeted position
*/
@NotNull
public Vector getHitVector() {
return hitVec;
}
}