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-05-29 22:58:57 +02:00
|
|
|
index 025cdeecfd26aed350bda6098714608b31c6d513..c11b9afdf8d5f6f61aa2e07f6e5b78855bf5d8bd 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 18:42:50 +02:00
|
|
|
@@ -1154,4 +1154,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
|
|
|
|
}
|