aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch')
-rw-r--r--patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch b/patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch
new file mode 100644
index 0000000000..bc32e3307d
--- /dev/null
+++ b/patches/server/0958-Broadcast-take-item-packets-with-collector-as-source.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: booky10 <[email protected]>
+Date: Sun, 29 Oct 2023 02:36:10 +0100
+Subject: [PATCH] Broadcast take item packets with collector as source
+
+This fixes players (which can't view the collector) seeing item pickups with themselves as the target.
+
+diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+index 549bb5caa38e08196fddbd4e4255b499c784a9c2..294c4950ebe63a5d0f74907692010c9c99cf82da 100644
+--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+@@ -3716,7 +3716,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+
+ public void take(Entity item, int count) {
+ if (!item.isRemoved() && !this.level().isClientSide && (item instanceof ItemEntity || item instanceof AbstractArrow || item instanceof ExperienceOrb)) {
+- ((ServerLevel) this.level()).getChunkSource().broadcast(item, new ClientboundTakeItemEntityPacket(item.getId(), this.getId(), count));
++ ((ServerLevel) this.level()).getChunkSource().broadcastAndSend(this, new ClientboundTakeItemEntityPacket(item.getId(), this.getId(), count)); // Paper - broadcast with collector as source
+ }
+
+ }