mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Add getFacing method to get the current cardinal direction an entity is facing.
By: Senmori <thesenmori@gmail.com>
This commit is contained in:
parent
0eec8c8041
commit
3208cbdd7f
@ -5,7 +5,9 @@ import org.bukkit.EntityEffect;
|
||||
import org.bukkit.Nameable;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.material.Directional;
|
||||
import org.bukkit.metadata.Metadatable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
@ -508,4 +510,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable {
|
||||
* @return reaction
|
||||
*/
|
||||
PistonMoveReaction getPistonMoveReaction();
|
||||
|
||||
/**
|
||||
* Get the closest cardinal {@link BlockFace} direction an entity is
|
||||
* currently facing.
|
||||
* <br>
|
||||
* This will not return any non-cardinal directions such as
|
||||
* {@link BlockFace#UP} or {@link BlockFace#DOWN}.
|
||||
* <br>
|
||||
* {@link Hanging} entities will override this call and thus their behavior
|
||||
* may be different.
|
||||
*
|
||||
* @return the entity's current cardinal facing.
|
||||
* @see Hanging
|
||||
* @see Directional#getFacing()
|
||||
*/
|
||||
BlockFace getFacing();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user