mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-06 02:42:14 +01:00
e886d8118e
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing
40 lines
1.8 KiB
Diff
40 lines
1.8 KiB
Diff
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/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index 2a1b17717b37e5f839e357c2196287a4024852e9..3c23a8ab3fe5e4b58816cf051dbe237530bff4a0 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -69,7 +69,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 1fc356d0b74c1cbb19bf7527088f1f61b6da5422..16e69cfd4994fd6850ee3635ea819379412351c9 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -815,5 +815,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
|
|
}
|