diff --git a/patches/api/Missing-Entity-API.patch b/patches/api/Missing-Entity-API.patch index d6468af388..546eb6ddc0 100644 --- a/patches/api/Missing-Entity-API.patch +++ b/patches/api/Missing-Entity-API.patch @@ -512,6 +512,68 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + void setExplosionPower(int explosionPower); + // Paper end } +diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/entity/LivingEntity.java ++++ b/src/main/java/org/bukkit/entity/LivingEntity.java +@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource + void clearActiveItem(); + // Paper end + ++ // Paper start ++ /** ++ * Retrieves the sideways movement direction of the entity. ++ *

++ * The returned value ranges from -1 to 1, where: ++ * - Positive 1 represents movement to the left. ++ * - Negative 1 represents movement to the right. ++ *

++ * Please note that for entities of type {@link Player}, this value is updated only when riding another entity. ++ *

++ * This method specifically provides information about the entity's sideways movement, whereas {@link #getVelocity()} returns ++ * a vector representing the entity's overall current momentum. ++ * ++ * @return Sideways movement direction, ranging from -1 (right) to 1 (left). ++ */ ++ float getSidewaysMovement(); ++ ++ /** ++ * Retrieves the upwards movement direction of the entity. ++ *

++ * The returned value ranges from -1 to 1, where: ++ * - Positive 1 represents upward movement. ++ * - Negative 1 represents downward movement. ++ *

++ * Please note that for entities of type {@link Player}, this value is never updated. ++ *

++ * This method specifically provides information about the entity's vertical movement, ++ * whereas {@link #getVelocity()} returns a vector representing the entity's overall ++ * current momentum. ++ * ++ * @return Upwards movement direction, ranging from -1 (downward) to 1 (upward). ++ */ ++ float getUpwardsMovement(); ++ ++ /** ++ * Retrieves the forwards movement direction of the entity. ++ *

++ * The returned value ranges from -1 to 1, where: ++ * - Positive 1 represents movement forwards. ++ * - Negative 1 represents movement backwards. ++ *

++ * Please note that for entities of type {@link Player}, this value is updated only when riding another entity. ++ *

++ * This method specifically provides information about the entity's forward and backward movement, ++ * whereas {@link #getVelocity()} returns a vector representing the entity's overall current momentum. ++ * ++ * @return Forwards movement direction, ranging from -1 (backward) to 1 (forward). ++ */ ++ float getForwardsMovement(); ++ // Paper end ++ + /** + * Get's remaining time a player needs to keep hands raised with an item to finish using it. + * @return Remaining ticks to use the item diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Llama.java diff --git a/patches/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch index b6687c5845..e20e5747d4 100644 --- a/patches/server/Missing-Entity-API.patch +++ b/patches/server/Missing-Entity-API.patch @@ -746,6 +746,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { + this.getHandle().persistentInvisibility = invisible; + this.getHandle().setSharedFlag(5, invisible); + } ++ // Paper start ++ @Override ++ public float getSidewaysMovement() { ++ return this.getHandle().xxa; ++ } ++ ++ @Override ++ public float getForwardsMovement() { ++ return this.getHandle().zza; ++ } ++ ++ @Override ++ public float getUpwardsMovement() { ++ return this.getHandle().yya; ++ } ++ // Paper end + + // Paper start + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java