aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0932-Add-Entity-Body-Yaw-API.patch
blob: 6381bc95be43982b7bc3ab4e9fda9c510dcf465a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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


diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 40c80ba7fa6e0505c23e643acbc87fd03b69e208..7880631fe8a4b06f29ef69ab850129737a99521b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1029,6 +1029,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
         this.damageItemStack0(this.getHandle().getItemBySlot(nmsSlot), amount, nmsSlot);
     }
 
+    @Override
+    public float getBodyYaw() {
+        return this.getHandle().getVisualRotationYInDegrees();
+    }
+
+    @Override
+    public void setBodyYaw(float bodyYaw) {
+        this.getHandle().setYBodyRot(bodyYaw);
+    }
+
     private void damageItemStack0(net.minecraft.world.item.ItemStack nmsStack, int amount, net.minecraft.world.entity.EquipmentSlot slot) {
         nmsStack.hurtAndBreak(amount, this.getHandle(), livingEntity -> {
             if (slot != null) {