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-07-29 00:28:28 +02:00
|
|
|
index ac513d3162a0794f226abc80bff21c799fe5802c..7c7501b4b21530d0641774f64e87d7d1ca71a33c 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-07-29 00:28:28 +02:00
|
|
|
@@ -1183,6 +1183,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-23 23:37:20 +02:00
|
|
|
index 89af84b8ff3aac5269dfb2b069a6e23742b82b4e..413a58d025cc7baf794e1f2866c3582504df4daf 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-21 20:06:31 +02:00
|
|
|
@@ -1163,4 +1163,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
|
|
|
|
}
|