aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason <[email protected]>2021-12-14 13:07:42 -0800
committerGitHub <[email protected]>2021-12-14 22:07:42 +0100
commit95d881f91681b2ff3a659578f42dd890f2b6ceec (patch)
tree51e49c86a908fa97fbd57e561657258f96f6ec0e
parent51d168752bc22bc37ade1d4577355cad6146ba56 (diff)
downloadPaper-95d881f91681b2ff3a659578f42dd890f2b6ceec.tar.gz
Paper-95d881f91681b2ff3a659578f42dd890f2b6ceec.zip
Fix WorldGenRegion leak when converting pre-1.18 chunks (#7097)
Co-authored-by: Nassim Jahnke <[email protected]>
-rw-r--r--patches/server/0831-Fix-WorldGenRegion-leak-when-converting-pre-1.18-chu.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/server/0831-Fix-WorldGenRegion-leak-when-converting-pre-1.18-chu.patch b/patches/server/0831-Fix-WorldGenRegion-leak-when-converting-pre-1.18-chu.patch
new file mode 100644
index 0000000000..2768b9635e
--- /dev/null
+++ b/patches/server/0831-Fix-WorldGenRegion-leak-when-converting-pre-1.18-chu.patch
@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jason Penilla <[email protected]>
+Date: Sun, 12 Dec 2021 04:43:30 -0800
+Subject: [PATCH] Fix WorldGenRegion leak when converting pre-1.18 chunks
+
+The Blender passed in here holds a WorldGenRegion which contains a list of surrounding chunks
+
+diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+index 96cb3e8cad9e7a5edd2a448ea88f2447104fbb5a..5aeaaae6f15050a2da271fe196d0a234ecafc8a1 100644
+--- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
++++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java
+@@ -410,6 +410,11 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom
+ }
+
+ public NoiseChunk getOrCreateNoiseChunk(NoiseSampler noiseColumnSampler, Supplier<NoiseChunk.NoiseFiller> columnSampler, NoiseGeneratorSettings chunkGeneratorSettings, Aquifer.FluidPicker fluidLevelSampler, Blender blender) {
++ // Paper start - create a new one each time to avoid leaking
++ if (blender != Blender.empty()) {
++ return NoiseChunk.forChunk(this, noiseColumnSampler, columnSampler, chunkGeneratorSettings, fluidLevelSampler, blender);
++ }
++ // Paper end
+ if (this.noiseChunk == null) {
+ this.noiseChunk = NoiseChunk.forChunk(this, noiseColumnSampler, columnSampler, chunkGeneratorSettings, fluidLevelSampler, blender);
+ }