diff --git a/Spigot-Server-Patches/0407-Fix-CME-from-raids.patch b/Spigot-Server-Patches/0407-Fix-CME-from-raids.patch deleted file mode 100644 index b7799bee1..000000000 --- a/Spigot-Server-Patches/0407-Fix-CME-from-raids.patch +++ /dev/null @@ -1,23 +0,0 @@ -From c846b7f9757ee1c83c7b4aa80c3b1a1458566e67 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Wed, 26 Jun 2019 01:20:55 +0100 -Subject: [PATCH] Fix CME from raids - -Use the iterator to remove elements - -diff --git a/src/main/java/net/minecraft/server/Raid.java b/src/main/java/net/minecraft/server/Raid.java -index 6c1bbefd71..58c33f1000 100644 ---- a/src/main/java/net/minecraft/server/Raid.java -+++ b/src/main/java/net/minecraft/server/Raid.java -@@ -144,7 +144,7 @@ public class Raid { - BlockPosition blockposition = new BlockPosition(entityplayer); - - if (this.k.c_(blockposition) != this) { -- set.remove(entityplayer); -+ iterator.remove(); // Paper - Use iterator - this.r.removePlayer(entityplayer); - } - } --- -2.22.0 - diff --git a/Spigot-Server-Patches/0407-Fix-Raids-CME.patch b/Spigot-Server-Patches/0407-Fix-Raids-CME.patch new file mode 100644 index 000000000..11b951920 --- /dev/null +++ b/Spigot-Server-Patches/0407-Fix-Raids-CME.patch @@ -0,0 +1,30 @@ +From 96e47b61a7b56b3593c1fd8058c970ee09efb490 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Wed, 26 Jun 2019 03:04:45 +0100 +Subject: [PATCH] Fix Raids CME + + +diff --git a/src/main/java/net/minecraft/server/Raid.java b/src/main/java/net/minecraft/server/Raid.java +index 6c1bbefd71..72f76d6c02 100644 +--- a/src/main/java/net/minecraft/server/Raid.java ++++ b/src/main/java/net/minecraft/server/Raid.java +@@ -137,14 +137,14 @@ public class Raid { + private void y() { + Collection collection = this.r.getPlayers(); + Set set = Sets.newHashSet(collection); +- Iterator iterator = collection.iterator(); ++ Iterator iterator = set.iterator(); // Paper - use the set, this doesn't get modified out of scope + + while (iterator.hasNext()) { + EntityPlayer entityplayer = (EntityPlayer) iterator.next(); + BlockPosition blockposition = new BlockPosition(entityplayer); + + if (this.k.c_(blockposition) != this) { +- set.remove(entityplayer); ++ iterator.remove(); // Paper + this.r.removePlayer(entityplayer); + } + } +-- +2.22.0 +