2019-06-14 04:27:40 +02:00
|
|
|
From c8f5fe34c25b6b569a5ecc7408ffc112270a6d6e Mon Sep 17 00:00:00 2001
|
2019-03-24 18:00:42 +01:00
|
|
|
From: AgentTroll <woodyc40@gmail.com>
|
|
|
|
Date: Fri, 22 Mar 2019 22:24:03 -0700
|
2019-03-24 22:48:22 +01:00
|
|
|
Subject: [PATCH] Update entity Metadata for all tracked players
|
2019-03-24 18:00:42 +01:00
|
|
|
|
|
|
|
|
2019-05-06 02:57:14 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
2019-06-03 04:19:44 +02:00
|
|
|
index afd8748da8..17b6ab57c2 100644
|
2019-05-06 02:57:14 +02:00
|
|
|
--- 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) {
|
2019-03-24 18:00:42 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2019-06-03 04:19:44 +02:00
|
|
|
index 69d39a47ba..4e8b8f49c4 100644
|
2019-03-24 18:00:42 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2019-06-03 04:19:44 +02:00
|
|
|
@@ -2027,7 +2027,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2019-03-24 18:00:42 +01:00
|
|
|
|
|
|
|
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));
|
2019-03-24 22:48:22 +01:00
|
|
|
+ entity.tracker.broadcast(new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true)); // Paper - update entity for all players
|
2019-03-24 18:00:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
--
|
|
|
|
2.21.0
|
|
|
|
|