mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 19:15:32 +01:00
40 lines
1.9 KiB
Diff
40 lines
1.9 KiB
Diff
From 3408da94a3a428e0304b92ff3cdbd81bfc5df56e 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 cd7e0299ac..460c687d3e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
|
@@ -379,6 +379,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 b030269f0a..79054b4519 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -1995,7 +1995,7 @@ 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));
|
|
+ entity.tracker.broadcast(new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true)); // Paper - update entity for all players
|
|
}
|
|
|
|
if (event.isCancelled()) {
|
|
--
|
|
2.22.0
|
|
|