42 lines
2.2 KiB
Diff
42 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: chickeneer <emcchickeneer@gmail.com>
|
|
Date: Mon, 6 Sep 2021 02:05:16 -0500
|
|
Subject: [PATCH] Mitigate ConcurrentModificationException by copying
|
|
entitySection access
|
|
|
|
Original code by Starlis, licensed under GNU General Public License v3.0
|
|
You can find the original code on https://github.com/starlis/empirecraft
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
|
index 3d5f38a1ca0206e5bcae4ed49d3df7ce0967f722..649df137ac36a62e53b42b7675c606e9e57795b2 100644
|
|
--- a/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
|
+++ b/src/main/java/net/minecraft/world/level/entity/PersistentEntitySectionManager.java
|
|
@@ -264,23 +264,23 @@ public class PersistentEntitySectionManager<T extends EntityAccess> implements A
|
|
if (flag2 && !flag3) {
|
|
entitysection.getEntities().filter((entityaccess) -> {
|
|
return !entityaccess.isAlwaysTicking();
|
|
- }).forEach(this::stopTicking);
|
|
+ }).collect(Collectors.toList()).forEach(this::stopTicking); // EMC
|
|
}
|
|
|
|
if (flag && !flag1) {
|
|
entitysection.getEntities().filter((entityaccess) -> {
|
|
return !entityaccess.isAlwaysTicking();
|
|
- }).forEach(this::stopTracking);
|
|
+ }).collect(Collectors.toList()).forEach(this::stopTracking); // EMC
|
|
} else if (!flag && flag1) {
|
|
entitysection.getEntities().filter((entityaccess) -> {
|
|
return !entityaccess.isAlwaysTicking();
|
|
- }).forEach(this::startTracking);
|
|
+ }).collect(Collectors.toList()).forEach(this::startTracking); // EMC
|
|
}
|
|
|
|
if (!flag2 && flag3) {
|
|
entitysection.getEntities().filter((entityaccess) -> {
|
|
return !entityaccess.isAlwaysTicking();
|
|
- }).forEach(this::startTicking);
|
|
+ }).collect(Collectors.toList()).forEach(this::startTicking); // EMC
|
|
}
|
|
|
|
});
|