aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch
diff options
context:
space:
mode:
authorAikar <[email protected]>2020-06-28 04:35:41 -0400
committerAikar <[email protected]>2020-06-28 04:35:41 -0400
commitb6925c36afa7565cac8f9fe9d3432fe658ca1f77 (patch)
treed64424c2e64e933af075b26c6888e526d7633b69 /Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch
parent5e9cc3a2281589ee6e0ca736712432ba4a0935cd (diff)
downloadPaper-b6925c36afa7565cac8f9fe9d3432fe658ca1f77.tar.gz
Paper-b6925c36afa7565cac8f9fe9d3432fe658ca1f77.zip
Remove no longer needed undead horse leash patch
This is now default vanilla behavior Fixes #3644
Diffstat (limited to 'Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch')
-rw-r--r--Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch b/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch
new file mode 100644
index 0000000000..cb3132667f
--- /dev/null
+++ b/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: AgentTroll <[email protected]>
+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()) {