diff options
author | Nassim Jahnke <[email protected]> | 2024-06-16 12:56:00 +0200 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-06-16 12:56:00 +0200 |
commit | dc684c60d16f66ea84467ec8e253f2a36a17a7c8 (patch) | |
tree | e516f1bd4bfbdb37a5aeee42384aade111eca3e1 /patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch | |
parent | 752f957e12e4ceb8b7d2043a4a7dbce786b7b98f (diff) | |
download | Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.tar.gz Paper-dc684c60d16f66ea84467ec8e253f2a36a17a7c8.zip |
Remove bad server.scheduleOnMain disconnect calls from old patches
The new behavior of disconnect to block the current thread until the disconnect succeeded is better than throwing it off to happen at some point
Diffstat (limited to 'patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch')
-rw-r--r-- | patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch b/patches/server/0907-Broadcast-take-item-packets-with-collector-as-source.patch new file mode 100644 index 0000000000..f114e5e960 --- /dev/null +++ b/patches/server/0907-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 c8c52514777a97b35bd4fb2ac84565f07c8921d7..9a2b874594e2f04f59b7d2be389223604d56219a 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -3720,7 +3720,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 + } + + } |