Files
MiraiMC/patches/server/0087-Fix-head-rotation-packet-spam.patch
etil2jz ac9967167c Update Upstream (Pufferfish)
Also drop merged PRs and patches replaced by the new chunk system
2022-10-13 12:48:37 +02:00

26 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: cswhite2000 <18whitechristop@gmail.com>
Date: Sun, 5 Aug 2018 15:00:46 -0700
Subject: [PATCH] Fix head rotation packet spam
Original license: GPLv3
Original project: https://github.com/Electroid/SportPaper
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index aa1bd3423829900729d413a5f98f4a0b9aaf6135..82604712640140dbc5ec632233b937b2e073e28e 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -342,8 +342,10 @@ public class ServerEntity {
}
// CraftBukkit start - Fix for nonsensical head yaw
- this.yHeadRotp = Mth.floor(this.entity.getYHeadRot() * 256.0F / 360.0F);
- consumer.accept(new ClientboundRotateHeadPacket(this.entity, (byte) this.yHeadRotp));
+ if (this.entity instanceof LivingEntity) { // SportPaper - Fix head rotation packet spam
+ this.yHeadRotp = Mth.floor(this.entity.getYHeadRot() * 256.0F / 360.0F);
+ consumer.accept(new ClientboundRotateHeadPacket(this.entity, (byte) this.yHeadRotp));
+ }
// CraftBukkit end
if (this.entity instanceof LivingEntity) {