mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 14:59:25 +00:00
52 lines
3.1 KiB
Diff
52 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
|
|
Date: Tue, 14 Oct 2025 01:50:40 +0300
|
|
Subject: [PATCH] Pufferfish: Better checking for useless move packets
|
|
|
|
This patch is based on the following patch:
|
|
"Better checking for useless move packets"
|
|
By: Paul Sauve <paul@technove.co>
|
|
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
|
|
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
|
index cfa2c3aa357a0dbb7edf7f0c8cebea5ed2f31cbc..d8ac41bacbb2303eacac6d96dd829865346f5b3b 100644
|
|
--- a/net/minecraft/server/level/ServerEntity.java
|
|
+++ b/net/minecraft/server/level/ServerEntity.java
|
|
@@ -181,18 +181,24 @@ public class ServerEntity {
|
|
packet = ClientboundEntityPositionSyncPacket.of(this.entity);
|
|
flag3 = true;
|
|
flag4 = true;
|
|
- } else if ((!flag2 || !flag) && !(this.entity instanceof AbstractArrow)) {
|
|
- if (flag2) {
|
|
- packet = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short)l, (short)l1, (short)l2, this.entity.onGround());
|
|
- flag3 = true;
|
|
- } else if (flag) {
|
|
- packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
|
- flag4 = true;
|
|
- }
|
|
} else {
|
|
- packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short)l, (short)l1, (short)l2, b, b1, this.entity.onGround());
|
|
- flag3 = true;
|
|
- flag4 = true;
|
|
+ // DivineMC start - Pufferfish: Better checking for useless move packets
|
|
+ if (flag2 || flag || this.entity instanceof AbstractArrow) {
|
|
+ if ((!flag2 || !flag) && !(this.entity instanceof AbstractArrow)) {
|
|
+ if (flag2) {
|
|
+ packet = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) l, (short) l1, (short) l2, this.entity.onGround());
|
|
+ flag3 = true;
|
|
+ } else if (flag) {
|
|
+ packet = new ClientboundMoveEntityPacket.Rot(this.entity.getId(), b, b1, this.entity.onGround());
|
|
+ flag4 = true;
|
|
+ }
|
|
+ } else {
|
|
+ packet = new ClientboundMoveEntityPacket.PosRot(this.entity.getId(), (short) l, (short) l1, (short) l2, b, b1, this.entity.onGround());
|
|
+ flag3 = true;
|
|
+ flag4 = true;
|
|
+ }
|
|
+ }
|
|
+ // DivineMC end - Pufferfish: Better checking for useless move packets
|
|
}
|
|
|
|
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
|