-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create 1042-Fix-fetching-biomes-during-world-gen.patch
- Loading branch information
1 parent
8b23018
commit 6204d35
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
patches/server/1042-Fix-fetching-biomes-during-world-gen.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Newwind <support@newwindserver.com> | ||
Date: Sat, 13 Jul 2024 18:00:37 +0200 | ||
Subject: [PATCH] Fix fetching biomes during world generation | ||
|
||
getNoiseBiome() on LevelReader first attempts to getChunk() to get its cached noise biome, | ||
however, calling getChunk() on WorldGenRegion will cause a crash if the chunk isn't found | ||
"Requested chunk unavailable during world generation" | ||
This means features which attempt to fetch biomes during generation, such as LakeFeature, | ||
can cause the server to crash. This patch simply removes chunk lookups from getNoiseBiome() | ||
for WorldGenRegion by overriding the method. | ||
|
||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java | ||
index 5a8a33638..dfbdf0c62 100644 | ||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java | ||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java | ||
@@ -145,6 +145,13 @@ public class WorldGenRegion implements WorldGenLevel { | ||
return this.getChunk(chunkX, chunkZ, ChunkStatus.EMPTY); | ||
} | ||
|
||
+ // Paper start - Always use uncached noise to get biomes in WorldGenRegion | ||
+ @Override | ||
+ public Holder<Biome> getNoiseBiome(int biomeX, int biomeY, int biomeZ) { | ||
+ return this.getUncachedNoiseBiome(biomeX, biomeY, biomeZ); | ||
+ } | ||
+ // Paper end | ||
+ | ||
@Nullable | ||
@Override | ||
public ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { |