-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broadcast take item packets with collector as source (#9884)
This fixes players (which can't view the collector) seeing item pickups with themselves as the target.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
patches/server/1043-Broadcast-take-item-packets-with-collector-as-source.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: booky10 <boooky10@gmail.com> | ||
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 675d695989cef5d8fc2e85673efbb57ec1bb38bd..a76eb3d051db0229ed088b71c92ff3f131449007 100644 | ||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java | ||
@@ -3701,7 +3701,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 | ||
} | ||
|
||
} |