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 629c19ae29ce9b215364e2fca41b1fbb608c0493..1a6b22c41863315ec577fc42996b3264598219bf 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -345,6 +345,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public void setCooldown(@NotNull ItemType itemType, 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 4809201b15b82bf9526367295de5030b267cb4fa..bae92046540a7446a78114dc69a2236c1af26121 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -997,5 +997,21 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param quantity quantity of item */ void playPickupItemAnimation(@NotNull Item item, int quantity); + + /** + * 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 }