CavePVP-Stuff/cSpigot-master/spigot-server-Patches/0177-Fix-head-rotation-packet-spam.patch

28 lines
1.3 KiB
Diff
Raw Permalink Normal View History

2023-05-01 20:59:40 +02:00
From 88a5ef09609e0c460b194f2465a142ba6bbb90f7 Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
Date: Sat, 1 Jul 2017 04:51:31 +0100
Subject: [PATCH] Fix head rotation packet spam
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index ed26b9917..76edf13a9 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -419,8 +419,11 @@ public class EntityTrackerEntry {
}
// CraftBukkit start - Fix for nonsensical head yaw
- this.i = MathHelper.d(this.tracker.getHeadRotation() * 256.0F / 360.0F);
- this.broadcast(new PacketPlayOutEntityHeadRotation(this.tracker, (byte) i));
+ // MineHQ start - fix head rotation packet spam (properly)
+ if (this.tracker instanceof EntityLiving) {
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityHeadRotation(this.tracker, (byte) MathHelper.d(this.tracker.getHeadRotation() * 256.0F / 360.0F)));
+ }
+ // MineHQ end
// CraftBukkit end
if (this.tracker instanceof EntityLiving) {
--
2.13.3