2021-06-14 20:50:22 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2023-03-14 23:13:41 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
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
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
index 603e003fbd39870a0e249151885b3b8f3e120afe..6fe21c29aa9d119490fbf1d69eb03c146674cde5 100644
|
2023-03-14 23:13:41 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
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
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -180,7 +180,7 @@ public abstract class Player extends LivingEntity {
|
2023-03-14 23:13:41 +01:00
|
|
|
private Optional<GlobalPos> lastDeathLocation;
|
|
|
|
@Nullable
|
|
|
|
public FishingHook fishing;
|
|
|
|
- protected float hurtDir;
|
|
|
|
+ public float hurtDir; // Paper - protected -> public
|
2024-01-24 11:45:17 +01:00
|
|
|
public boolean affectsSpawning = true; // Paper - Affects Spawning API
|
|
|
|
|
|
|
|
// CraftBukkit start
|
2023-03-14 23:13:41 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
2024-04-06 21:53:39 +02:00
|
|
|
index d5a8f019e88de30400733cdc3178eb982ccca341..e7726862f99cb16b7335b06675af73db773b54e8 100644
|
2023-03-14 23:13:41 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
2024-04-06 21:53:39 +02:00
|
|
|
@@ -127,6 +127,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
2023-03-14 23:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public void setHurtDirection(float hurtDirection) {
|
|
|
|
+ this.getHandle().hurtDir = hurtDirection;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public int getSleepTicks() {
|
|
|
|
return this.getHandle().sleepCounter;
|
2021-06-14 20:50:22 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2024-04-06 23:44:27 +02:00
|
|
|
index 6848cdb3271b37972e98af78e85125409c650c4d..4ac52885618bf062eb34672b8fc60331a9c8f76a 100644
|
2021-06-14 20:50:22 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2024-04-06 23:44:27 +02:00
|
|
|
@@ -1006,4 +1006,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2024-04-06 21:53:39 +02:00
|
|
|
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
|
2021-06-14 20:50:22 +02:00
|
|
|
}
|
2024-04-06 21:53:39 +02:00
|
|
|
// Paper end - pickup animation API
|
2021-06-14 20:50:22 +02:00
|
|
|
+
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper start - hurt direction API
|
2021-06-14 20:50:22 +02:00
|
|
|
+ @Override
|
|
|
|
+ public float getHurtDirection() {
|
2023-03-14 23:13:41 +01:00
|
|
|
+ return this.getHandle().getHurtDir();
|
2021-06-14 20:50:22 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2024-04-06 21:53:39 +02:00
|
|
|
+ public void setHurtDirection(final float hurtDirection) {
|
2023-03-14 23:13:41 +01:00
|
|
|
+ throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
|
2021-06-14 20:50:22 +02:00
|
|
|
+ }
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper end - hurt direction API
|
2021-06-14 20:50:22 +02:00
|
|
|
}
|