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 f20b0a439c4d5cd2c6caa70a46b1b49f8ab23425..937c136f2499bd1660989d14c0f50a7ef9a1a2b6 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 a2489932c07b1b56d3e340ecfeddd3df95cf4eb6..4327045ec437c9c81bcd4c34c4959de6d5798132 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1201,4 +1201,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 }