mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-10 13:49:11 +01:00
Fix raids throwing an UnsupportedOperationException
This commit is contained in:
parent
55897098d6
commit
979c900640
@ -1,20 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Wed, 26 Jun 2019 01:20:55 +0100
|
||||
Subject: [PATCH] Fix CME from raids
|
||||
Date: Wed, 26 Jun 2019 03:04:45 +0100
|
||||
Subject: [PATCH] Fix Raids CME
|
||||
|
||||
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
|
||||
index 6c1bbefd71..72f76d6c02 100644
|
||||
--- a/src/main/java/net/minecraft/server/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/server/Raid.java
|
||||
@@ -0,0 +0,0 @@ public class Raid {
|
||||
private void y() {
|
||||
Collection<EntityPlayer> collection = this.r.getPlayers();
|
||||
Set<EntityPlayer> 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 - Use iterator
|
||||
+ iterator.remove(); // Paper
|
||||
this.r.removePlayer(entityplayer);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user