2023-02-09 18:31:51 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: TheTuso <piotrekpasztor@gmail.com>
|
|
|
|
Date: Thu, 2 Feb 2023 16:40:41 +0100
|
|
|
|
Subject: [PATCH] Add Entity Body Yaw API
|
|
|
|
|
|
|
|
|
2023-08-21 09:35:05 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2024-04-25 00:36:49 +02:00
|
|
|
index 365281dfc0308c5db0c72b56208d9b87be0e955e..991b94ff1186b1071a94b2662873dc071255e2e6 100644
|
2023-08-21 09:35:05 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2024-04-25 00:36:49 +02:00
|
|
|
@@ -1164,6 +1164,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2023-08-21 09:35:05 +02:00
|
|
|
}
|
2024-04-06 22:38:37 +02:00
|
|
|
// Paper end - entity powdered snow API
|
|
|
|
|
|
|
|
+ // Paper start - entity body yaw API
|
2023-08-21 09:35:05 +02:00
|
|
|
+ @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();
|
|
|
|
+ }
|
2024-04-06 22:38:37 +02:00
|
|
|
+ // Paper end - entity body yaw API
|
|
|
|
+
|
2024-03-23 22:26:17 +01:00
|
|
|
// Paper start - missing entity api
|
2024-04-06 22:38:37 +02:00
|
|
|
@Override
|
|
|
|
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
2023-02-09 18:31:51 +01: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-25 05:40:32 +02:00
|
|
|
index e9172aa5e3ff3ae0a507dcc059468416b9c475f6..9440a10f060fce2f7dd78b9d99605022c7b7f000 100644
|
2023-02-09 18:31:51 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2024-04-25 05:40:32 +02:00
|
|
|
@@ -1172,4 +1172,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2024-04-06 21:53:39 +02:00
|
|
|
this.getHandle().frictionState = state;
|
2023-02-09 18:31:51 +01:00
|
|
|
}
|
2024-04-06 21:53:39 +02:00
|
|
|
// Paper end - friction API
|
|
|
|
+
|
|
|
|
+ // Paper start - body yaw API
|
2023-02-09 18:31:51 +01:00
|
|
|
+ @Override
|
|
|
|
+ public float getBodyYaw() {
|
|
|
|
+ return this.getHandle().getVisualRotationYInDegrees();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2024-04-06 21:53:39 +02:00
|
|
|
+ public void setBodyYaw(final float bodyYaw) {
|
2023-02-09 18:31:51 +01:00
|
|
|
+ this.getHandle().setYBodyRot(bodyYaw);
|
|
|
|
+ }
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper end - body yaw API
|
|
|
|
}
|