2023-11-04 23:16:55 +01:00
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
2024-01-19 12:30:04 +01:00
index 85d743315ae0083636c6ffee2f5081e3def4c4ee..9fb5b4df574db63f005dc321ba76dcd92ffe67e3 100644
2023-11-04 23:16:55 +01:00
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
2024-01-16 12:41:40 +01:00
@@ -3704,7 +3704,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
2023-11-04 23:16:55 +01:00
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
}
}