Paper/Spigot-Server-Patches/0346-Update-entity-Metadata-for-all-tracked-players.patch
Aikar c0d07c1b67
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears 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:
f009c3dd SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
e677c370 Update ECJ version
5058a35d SPIGOT-5860: Item.setItemStack should be NotNull

CraftBukkit Changes:
d77f4d9b SPIGOT-5810, SPIGOT-5835: 'Better' handling of Player.isOnGround
53c95627 SPIGOT-5865: Piglin does not trigger EntityPickupItemEvent
2ab04d24 Update ECJ version
7884e079 SPIGOT-5868: Blocks do not tick in custom nether / end
2a848286 SPIGOT-5863: Don't check colour in scoreboard length validation
f2cbce30 SPIGOT-5866: Beehive unknown TargetReason

Spigot Changes:
ad703da0 SPIGOT-5870: /plugins "website" field shows "version"
1a27cfd8 #98: Improve output of /plugins command using text components
732d5bab Disable checkstyle in Spigot blocks
0199a9a6 #97: Add Memory Usage to Ticks Per Second Command.
33ea98fc SPIGOT-5858: NPE: Joining the server with an invalid dimension
2020-06-27 21:54:05 -04:00

44 lines
2.3 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/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index b5a76f37c27cde25b2561a23c7c0fe7bdd992fee..9b89c0c8a3f1dada4e9b2aaeed0b92e56229b7ca 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -392,6 +392,12 @@ public class EntityTrackerEntry {
return PacketPlayOutEntity.a(this.xLoc, this.yLoc, this.zLoc);
}
+ // Paper start - Add broadcast method
+ void broadcast(Packet<?> packet) {
+ this.getPacketConsumer().accept(packet);
+ }
+ // Paper end
+
private void broadcastIncludingSelf(Packet<?> packet) {
this.f.accept(packet);
if (this.tracker instanceof EntityPlayer) {
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 06e994f9483c3686e9b039c613668c86d90e4949..339e03fde358ce55badaa5be311f0b6972f72e3d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2046,7 +2046,14 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem) {
// Refresh the current entity metadata
- this.sendPacket(new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true));
+ // Paper start - update entity for all players
+ PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true);
+ if (entity.tracker != null) {
+ entity.tracker.broadcast(packet);
+ } else {
+ this.sendPacket(packet);
+ }
+ // Paper end
}
if (event.isCancelled()) {