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 bd7967680d7a75caff98a827895c795f2d101f99..a3acd40f24aae3c9809b76ce6f3e1b2d20acc5b1 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
|
|
}
|
|
|
|
});
|