mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Use wrapped StructureManager to prevent worldgen deadlock
This commit is contained in:
parent
976ac75539
commit
e113a7a6a0
1 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: MiniDigger | Martin <admin@minidigger.dev>
|
||||
Date: Wed, 2 Sep 2020 13:56:18 +0200
|
||||
Subject: [PATCH] Use wrapped StructureManager to prevent worldgen deadlock
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
|
||||
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
|
||||
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
|
||||
private final BiomeManager m;
|
||||
private final ChunkCoordIntPair n;
|
||||
private final ChunkCoordIntPair o;
|
||||
+ private final StructureManager structureManager; // Paper - cache wrapped structure manager
|
||||
|
||||
public RegionLimitedWorldAccess(WorldServer worldserver, List<IChunkAccess> list) {
|
||||
int i = MathHelper.floor(Math.sqrt((double) list.size()));
|
||||
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
|
||||
this.m = new BiomeManager(this, BiomeManager.a(this.g), worldserver.getDimensionManager().getGenLayerZoomer());
|
||||
this.n = ((IChunkAccess) list.get(0)).getPos();
|
||||
this.o = ((IChunkAccess) list.get(list.size() - 1)).getPos();
|
||||
+ this.structureManager = this.f.getStructureManager().a(this); // Paper - cache wrapped structure manager
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed {
|
||||
|
||||
@Override
|
||||
public Stream<? extends StructureStart<?>> a(SectionPosition sectionposition, StructureGenerator<?> structuregenerator) {
|
||||
- return this.f.a(sectionposition, structuregenerator);
|
||||
+ return structureManager.a(sectionposition, structuregenerator); // Paper - wrapped structure manager to prevent deadlock, see #4272 and MC-199487
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue