aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch')
-rw-r--r--patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch b/patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch
new file mode 100644
index 0000000000..8c8b6b3629
--- /dev/null
+++ b/patches/unapplied/server/0783-Add-Entity-Body-Yaw-API.patch
@@ -0,0 +1,65 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: TheTuso <[email protected]>
+Date: Thu, 2 Feb 2023 16:40:41 +0100
+Subject: [PATCH] Add Entity Body Yaw API
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+index ca9cda9059a5c1dae1ca9ec09248768274d4e207..e65d1ca701d835db0ed45e627c92c1c5ed384887 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+@@ -1179,6 +1179,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
+ }
+ // Paper end - entity powdered snow API
+
++ // Paper start - entity body yaw API
++ @Override
++ public double getX() {
++ return this.entity.getX();
++ }
++
++ @Override
++ public double getY() {
++ return this.entity.getY();
++ }
++
++ @Override
++ public double getZ() {
++ return this.entity.getZ();
++ }
++
++ @Override
++ public float getPitch() {
++ return this.entity.getXRot();
++ }
++
++ @Override
++ public float getYaw() {
++ return this.entity.getBukkitYaw();
++ }
++ // Paper end - entity body yaw API
++
+ // Paper start - missing entity api
+ @Override
+ public boolean isInvisible() { // Paper - moved up from LivingEntity
+diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+index 2fd4a3068d86a37cc18c9203448823c53d590ffb..203e06fdff824ba67dce0e026f7ea5b746d7f258 100644
+--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+@@ -1211,4 +1211,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
+ this.getHandle().frictionState = state;
+ }
+ // Paper end - friction API
++
++ // Paper start - body yaw API
++ @Override
++ public float getBodyYaw() {
++ return this.getHandle().getVisualRotationYInDegrees();
++ }
++
++ @Override
++ public void setBodyYaw(final float bodyYaw) {
++ this.getHandle().setYBodyRot(bodyYaw);
++ }
++ // Paper end - body yaw API
+ }