Port basic lookAt methods from Player to Entity (#11775)
This commit is contained in:
@ -3,6 +3,7 @@ package org.bukkit.entity;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import io.papermc.paper.entity.LookAnchor;
|
||||
import org.bukkit.Chunk; // Paper
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Location;
|
||||
@ -150,6 +151,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
* @return <code>true</code> if the teleport was successful
|
||||
*/
|
||||
boolean teleport(@NotNull Location location, @NotNull TeleportCause cause, @NotNull io.papermc.paper.entity.TeleportFlag @NotNull... teleportFlags);
|
||||
|
||||
/**
|
||||
* Causes the entity to look towards the given position.
|
||||
*
|
||||
* @param x x coordinate
|
||||
* @param y y coordinate
|
||||
* @param z z coordinate
|
||||
* @param entityAnchor What part of the entity should face the given position
|
||||
*/
|
||||
void lookAt(double x, double y, double z, @NotNull LookAnchor entityAnchor);
|
||||
|
||||
/**
|
||||
* Causes the entity to look towards the given position.
|
||||
*
|
||||
* @param position Position to look at in the player's current world
|
||||
* @param entityAnchor What part of the entity should face the given position
|
||||
*/
|
||||
default void lookAt(@NotNull io.papermc.paper.math.Position position, @NotNull LookAnchor entityAnchor) {
|
||||
this.lookAt(position.x(), position.y(), position.z(), entityAnchor);
|
||||
}
|
||||
// Paper end - Teleport API
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user