26 lines
1.3 KiB
Diff
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 bf314a8ea0145a82c5ff4fdff23444b8978845fe..3a0ff721e01e5bb2b2d05459019f8bba5f5d0737 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) {
|