aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch')
-rw-r--r--patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch10
1 files changed, 4 insertions, 6 deletions
diff --git a/patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch b/patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch
index 2df4bc442f..43d9b1f7e5 100644
--- a/patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch
+++ b/patches/server/0435-Fix-Concurrency-issue-in-ShufflingList.patch
@@ -7,7 +7,7 @@ if multiple threads from worldgen sort at same time, it will crash.
So make a copy of the list for sorting purposes.
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
-index 93c9075a5a1fe8bc27b8cfef13f84689f75580f3..ef1e9457aa215afd0d9a0a9cda2f6b5c4ac6974f 100644
+index 3288afe9aaf69c32a92b172fb1aaf3fbb8a494a5..5ca112631cce775c609950d3540059f54033fd3e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GateBehavior.java
@@ -18,7 +18,7 @@ public class GateBehavior<E extends LivingEntity> implements BehaviorControl<E>
@@ -20,7 +20,7 @@ index 93c9075a5a1fe8bc27b8cfef13f84689f75580f3..ef1e9457aa215afd0d9a0a9cda2f6b5c
public GateBehavior(
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
-index 9b1203ce731f5de84c84fab149177ae6c7a389a3..21afbc0512c650399ebde59ac5938f83ef8439e8 100644
+index 195eea55fabc7a9a665e0a8f04934a3aaf9f8b71..3fac11bf02652b5f51f30f99bdf516504467d0d2 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
@@ -16,12 +16,25 @@ import net.minecraft.util.RandomSource;
@@ -49,13 +49,11 @@ index 9b1203ce731f5de84c84fab149177ae6c7a389a3..21afbc0512c650399ebde59ac5938f83
this.entries = Lists.newArrayList(list);
}
-@@ -37,11 +50,12 @@ public class ShufflingList<U> implements Iterable<U> {
+@@ -35,9 +48,12 @@ public class ShufflingList<U> implements Iterable<U> {
}
public ShufflingList<U> shuffle() {
-- this.entries.forEach(entry -> {
-- entry.setRandom(this.random.nextFloat());
-- });
+- this.entries.forEach(entry -> entry.setRandom(this.random.nextFloat()));
- this.entries.sort(Comparator.comparingDouble(ShufflingList.WeightedEntry::getRandWeight));
- return this;
+ // Paper start - Fix Concurrency issue in ShufflingList during worldgen