papermc/Spigot-Server-Patches/0129-Fix-some-players-not-being-kicked-on-shutdown.patch
2016-05-25 12:37:17 -04:00

27 lines
1.1 KiB
Diff

From b1d4330c0fd8473081cae9431e874043ff3433f8 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Tue, 29 Mar 2016 20:19:20 -0400
Subject: [PATCH] Fix some players not being kicked on shutdown
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 8075417..987e393 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1295,9 +1295,11 @@ public abstract class PlayerList {
}
public void u() {
- for (int i = 0; i < this.players.size(); ++i) {
- ((EntityPlayer) this.players.get(i)).playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
+ // Paper start - Fix players being skipped due to concurrent list modification
+ for (EntityPlayer player : com.google.common.collect.ImmutableList.copyOf(this.players)) {
+ player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message
}
+ // Paper end
}
--
2.8.3