From 819ff324354b61a2656fa0d8129275475478ccc1 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Wed, 2 Sep 2020 13:57:35 +0200 Subject: [PATCH] Use wrapped StructureManager to prevent worldgen deadlock --- ...ctureManager-to-prevent-worldgen-dea.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Spigot-Server-Patches/0576-Use-wrapped-StructureManager-to-prevent-worldgen-dea.patch diff --git a/Spigot-Server-Patches/0576-Use-wrapped-StructureManager-to-prevent-worldgen-dea.patch b/Spigot-Server-Patches/0576-Use-wrapped-StructureManager-to-prevent-worldgen-dea.patch new file mode 100644 index 0000000000..3f8b6306ea --- /dev/null +++ b/Spigot-Server-Patches/0576-Use-wrapped-StructureManager-to-prevent-worldgen-dea.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MiniDigger +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 e9fbeaf309735ea5fcb0c53b8b2485b0c5dd43be..9172c679c874d42750d2adc32124ecda29ea43cf 100644 +--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java ++++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +@@ -30,6 +30,7 @@ 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 list) { + int i = MathHelper.floor(Math.sqrt((double) list.size())); +@@ -51,6 +52,7 @@ 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 + } + } + +@@ -379,6 +381,6 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { + + @Override + public Stream> 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 + } + }