Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
6a7fef0e4a
* Allow entity effect modification off the main thread for worldgen * squash all async catcher patches
28 Zeilen
1.2 KiB
Diff
28 Zeilen
1.2 KiB
Diff
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 daf6653f30337ef88bad9decb7d73c45f951b270..d43859f8aa7beed82dd3a146bb1086982cd0cda7 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -1035,6 +1035,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) {
|