2020-04-12 00:39:21 +00:00
|
|
|
From 11b9ee1047c2291b8e8f991ae05c1bacd92d9a63 Mon Sep 17 00:00:00 2001
|
2019-03-24 17:00:42 +00:00
|
|
|
From: AgentTroll <woodyc40@gmail.com>
|
|
|
|
Date: Fri, 22 Mar 2019 22:24:03 -0700
|
2019-03-24 21:48:22 +00:00
|
|
|
Subject: [PATCH] Update entity Metadata for all tracked players
|
2019-03-24 17:00:42 +00:00
|
|
|
|
|
|
|
|
2019-05-06 00:57:14 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 3ff7a7b4a8..3a88c9a670 100644
|
2019-05-06 00:57:14 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
2019-12-12 16:20:43 +00:00
|
|
|
@@ -387,6 +387,12 @@ public class EntityTrackerEntry {
|
2019-05-06 00:57:14 +00:00
|
|
|
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 17:00:42 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-04-02 21:07:06 +00:00
|
|
|
index 94d3d602cc..eee96c3a1c 100644
|
2019-03-24 17:00:42 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
2020-02-09 00:32:48 +00:00
|
|
|
@@ -2006,7 +2006,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
2019-03-24 17:00:42 +00: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 21:48:22 +00:00
|
|
|
+ entity.tracker.broadcast(new PacketPlayOutEntityMetadata(entity.getId(), entity.datawatcher, true)); // Paper - update entity for all players
|
2019-03-24 17:00:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (event.isCancelled()) {
|
|
|
|
--
|
2020-03-15 20:03:36 +00:00
|
|
|
2.25.1
|
2019-03-24 17:00:42 +00:00
|
|
|
|