Paper/patches/server/0317-Dont-send-unnecessary-sign-update.patch

19 lines
1.2 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Sat, 11 Sep 2021 11:56:51 +0200
Subject: [PATCH] Dont send unnecessary sign update
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 584feb744bd2aa34f788de17d43c16a04c33a2c6..41c863a104d53b6c6feb4576d5b62cead229efec 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -185,6 +185,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
} else {
SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
+ if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < 32 * 32) // Paper
((ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
}
}