aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0540-Expose-LivingEntity-hurt-direction.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0540-Expose-LivingEntity-hurt-direction.patch')
-rw-r--r--patches/server/0540-Expose-LivingEntity-hurt-direction.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0540-Expose-LivingEntity-hurt-direction.patch b/patches/server/0540-Expose-LivingEntity-hurt-direction.patch
new file mode 100644
index 0000000000..ff8defb04b
--- /dev/null
+++ b/patches/server/0540-Expose-LivingEntity-hurt-direction.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mark Vainomaa <[email protected]>
+Date: Sun, 13 Dec 2020 05:32:05 +0200
+Subject: [PATCH] Expose LivingEntity hurt direction
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+index 4e7cb29909fd82d26029e4c78580ead500db5c2a..d16ea002ca558502be2f04528f0346d9aacff30f 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+@@ -896,5 +896,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+ public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
+ getHandle().take(((CraftItem) item).getHandle(), quantity);
+ }
++
++ @Override
++ public float getHurtDirection() {
++ return getHandle().hurtDir;
++ }
++
++ @Override
++ public void setHurtDirection(float hurtDirection) {
++ getHandle().hurtDir = hurtDirection;
++ }
+ // Paper end
+ }