From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: TheTuso Date: Thu, 2 Feb 2023 16:40:11 +0100 Subject: [PATCH] Add Entity Body Yaw API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java index 2d6f7b2bf4cb23ef43a4dcbab2ecd2a7c7c2809c..0be4107270fb7fdba5c7d0e6f3964d33337f91f0 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -1026,6 +1026,43 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent * @return true if in powdered snow. */ boolean isInPowderedSnow(); + + /** + * Gets the x-coordinate of this entity + * + * @return x-coordinate + */ + double getX(); + + /** + * Gets the y-coordinate of this entity + * + * @return y-coordinate + */ + double getY(); + + /** + * Gets the z-coordinate of this entity + * + * @return z-coordinate + */ + double getZ(); + + /** + * Gets this entity's pitch + * + * @see Location#getPitch() + * @return the entity's pitch + */ + float getPitch(); + + /** + * Gets this entity's yaw + * + * @see Location#getYaw() + * @return the entity's yaw + */ + float getYaw(); // Paper end // Paper start - Collision API diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 017a743c1445e2c859fef0ef962e656035af12bd..b8a9b56c3071d94371ab69b1a72c2e6c0692ab39 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1412,4 +1412,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ void damageItemStack(org.bukkit.inventory.@NotNull EquipmentSlot slot, int amount); // Paper end - ItemStack damage API + + // Paper start - body yaw API + /** + * Gets entity body yaw + * + * @return entity body yaw + * @see Location#getYaw() + */ + float getBodyYaw(); + + /** + * Sets entity body yaw + * + * @param bodyYaw new entity body yaw + * @see Location#setYaw(float) + */ + void setBodyYaw(float bodyYaw); + // Paper end - body yaw API }