aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0616-Expose-LivingEntity-hurt-direction.patch
blob: 85a61eeb6edf3254a73dd6d5cfd34c2738d77d03 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
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/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index b56c801c02e4f206b72db7dd74672727104bf246..b1adb0ddfeb94de6f92f40a7e9e586e00455160d 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -163,7 +163,7 @@ public abstract class EntityLiving extends Entity {
     public int am;
     public int hurtTicks;
     public int hurtDuration;
-    public float ap;
+    public float ap; public final float getHurtDirection() { return ap; } public final void setHurtDirection(float hurtDirection) { this.ap = hurtDirection; } // Paper - OBFHELPER
     public int deathTicks;
     public float ar;
     public float as;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 3bee6903a591bbfe312c6d7e276d7cef3dafc852..278a1c886f15b75e62bfe4c872fc779eda83c988 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -830,5 +830,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
     public void playPickupItemAnimation(org.bukkit.entity.Item item, int quantity) {
         getHandle().receive(((CraftItem) item).getHandle(), quantity);
     }
+
+    @Override
+    public float getHurtDirection() {
+        return getHandle().getHurtDirection();
+    }
+
+    @Override
+    public void setHurtDirection(float hurtDirection) {
+        getHandle().setHurtDirection(hurtDirection);
+    }
     // Paper end
 }