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
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
2023-07-04 10:22:56 +02:00
|
|
|
index b166ca8b8d21b3f7e930fa9b9b71fbca70bfdb97..73cd175cba0e441b8af63d8c05ae0d9143687995 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
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -1056,6 +1056,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
2023-02-09 18:31:51 +01:00
|
|
|
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) {
|