aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch')
-rw-r--r--patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch b/patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch
new file mode 100644
index 0000000000..cb02caeb92
--- /dev/null
+++ b/patches/server/1060-Call-CraftPlayer-onEntityRemove-for-all-online-playe.patch
@@ -0,0 +1,19 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Gero <[email protected]>
+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
+index 0a46bf03f9a55c7453f042cba6f448d4d0bcd1e6..3d09c0c9ca3541c2b3b6feeb426eeffbdaeef69c 100644
+--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
+@@ -2786,7 +2786,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);
+ }
+ }