aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0545-Expose-LivingEntity-hurt-direction.patch
blob: 2f461711f6fbc782490c7842b4b8352280b37c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
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 24ffc967391c9ba175f41396a90007ecdc32f55c..0293d6fd1bb29f75fa1fa1cdfa36b3f679c1bc45 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -850,5 +850,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
 }