PaperMC/patches/server/1018-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch

20 lines
1.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Gero <gecam59@gmail.com>
Date: Sat, 9 Nov 2024 22:27:58 +0100
Subject: [PATCH] Call CraftPlayer#onEntityRemove for all online players
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
2024-12-05 11:18:29 +01:00
index c52ed5fe9f67c62c16cb4a0f6dc33c0050f487c6..f02fbe3d1ba00c9b1fb8533da22d2670870316bf 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
2024-12-05 11:18:29 +01:00
@@ -2413,7 +2413,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// CraftBukkit start
entity.valid = false;
if (!(entity instanceof ServerPlayer)) {
- for (ServerPlayer player : ServerLevel.this.players) {
+ for (ServerPlayer player : ServerLevel.this.server.getPlayerList().players) { // Paper - call onEntityRemove for all online players
player.getBukkitEntity().onEntityRemove(entity);
}
}