aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0220-Expose-LivingEntity-hurt-direction.patch
blob: 4d2cb26c38ad19d0ddd03f4f2b01636a51750d81 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
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 b980d55b68ed9da78c5cd19f369bb00dccbf08e1..4d6ceca22d98a3e46aa26ef26176c5417a5ccf35 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -354,6 +354,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
 }