PaperMC/patches/server/0307-Update-entity-Metadata-for-all-tracked-players.patch
Nassim Jahnke d385af0e01
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
0a4b84d6 SPIGOT-7003: Add missing PlayerAnimationType
830db7d5 SPIGOT-5984: Add non deprecated / magic value way to set pixel in MapCanvas
20caf8ff PR-754: Add DamageCause.SONIC_BOOM

CraftBukkit Changes:
576a03704 SPIGOT-7003: Add missing PlayerAnimationType
0dcc5fdd0 SPIGOT-5984: Add non deprecated / magic value way to set pixel in MapCanvas
d75aacb43 Update Netty version
3b34c6bea SPIGOT-7044: Modified RandomSourceWrapper to ensure random is not null before setting seed
4b60bfd18 PR-1059: Add DamageCause.SONIC_BOOM
2022-06-09 13:55:33 +02:00

43 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AgentTroll <woodyc40@gmail.com>
Date: Fri, 22 Mar 2019 22:24:03 -0700
Subject: [PATCH] Update entity Metadata for all tracked players
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 232341fa41b1962d329cc17f3146e41c51d22164..2c43304fd7a189f399f0e7757dbd593f3f462c37 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -371,6 +371,12 @@ public class ServerEntity {
}
+ // Paper start - Add broadcast method
+ void broadcast(Packet<?> packet) {
+ this.broadcast.accept(packet);
+ }
+ // Paper end
+
private void broadcastAndSend(Packet<?> packet) {
this.broadcast.accept(packet);
if (this.entity instanceof ServerPlayer) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5384fe5c20141d1581ed31420b95d2b148e38d3e..9f8f29f3908294738943e698badd002c80fa6569 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2501,7 +2501,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) {
// Refresh the current entity metadata
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true));
+ // Paper start - update entity for all players
+ ClientboundSetEntityDataPacket packet1 = new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true);
+ if (entity.tracker != null) {
+ entity.tracker.broadcast(packet1);
+ } else {
+ ServerGamePacketListenerImpl.this.send(packet1);
+ }
+ // Paper end
}
if (event.isCancelled()) {