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-06-14 05:41:44 +02:00
|
|
|
index 3c1e199316ae283210529d4d27b4f9d70b4d9404..d8b1cdc78eb234023a42d740599009737201e70e 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-06-14 05:41:44 +02:00
|
|
|
@@ -1181,6 +1181,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-06-14 14:11:52 +02:00
|
|
|
index 195cbff1253ed864fb18984ff6db928aac2bf8aa..292e1701694b0cb0cb9103244e6e59e07b5838b2 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-06-14 05:41:44 +02:00
|
|
|
@@ -1162,4 +1162,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
|
|
|
|
}
|