From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 13 Dec 2020 05:32:12 +0200 Subject: [PATCH] Expose LivingEntity hurt direction diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java index d06539841d973030c0cd5bb06a085ed2f0f73af6..7759062ca34506c56d2d1340cf1d9c2d36151d48 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -356,6 +356,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public void setCooldown(@NotNull Material material, int ticks); + // Paper start + /** + * Sets player hurt direction + * + * @param hurtDirection hurt direction + */ + @Override + void setHurtDirection(float hurtDirection); + // Paper end + /** * Get the sleep ticks of the player. This value may be capped. * diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 784da48ffc63bc932caafe58cf56ad30e7a86be6..49352ed3928163c6322634b8e6f1d3dd8caa5e74 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1211,4 +1211,22 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ void playPickupItemAnimation(@NotNull Item item, int quantity); // Paper end - pickup animation API + + // Paper start - hurt direction API + /** + * Gets player hurt direction + * + * @return hurt direction + */ + float getHurtDirection(); + + /** + * Sets player hurt direction + * + * @param hurtDirection hurt direction + * @deprecated use {@link Player#setHurtDirection(float)} + */ + @Deprecated + void setHurtDirection(float hurtDirection); + // Paper end - hurt direction API }