mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-17 02:34:30 +01:00
Fix Delegation to vanilla chunk gen
This broke in 1.16.1, when upstream changed stuff around and introduced this delegate field. Closes #4097
This commit is contained in:
parent
1023360683
commit
7e7a3d372a
1 changed files with 16 additions and 0 deletions
|
@ -47,6 +47,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ net.minecraft.server.RegionLimitedWorldAccess genRegion = new net.minecraft.server.RegionLimitedWorldAccess(nmsWorld, list);
|
||||
+ // call vanilla generator, one feature after another. Order here is important!
|
||||
+ net.minecraft.server.ChunkGenerator chunkGenerator = nmsWorld.getChunkProvider().chunkGenerator;
|
||||
+ if (chunkGenerator instanceof org.bukkit.craftbukkit.generator.CustomChunkGenerator) {
|
||||
+ chunkGenerator = ((org.bukkit.craftbukkit.generator.CustomChunkGenerator) chunkGenerator).delegate;
|
||||
+ }
|
||||
+ chunkGenerator.createBiomes(nmsWorld.r().b(IRegistry.ay), protoChunk);
|
||||
+ chunkGenerator.buildNoise(genRegion, nmsWorld.getStructureManager(), protoChunk);
|
||||
+ chunkGenerator.buildBase(genRegion, protoChunk);
|
||||
|
@ -86,3 +89,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
Set<BlockPosition> getTiles() {
|
||||
return tiles;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java
|
||||
@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator.ChunkData;
|
||||
|
||||
public class CustomChunkGenerator extends InternalChunkGenerator {
|
||||
|
||||
- private final net.minecraft.server.ChunkGenerator delegate;
|
||||
+ public final net.minecraft.server.ChunkGenerator delegate; // Paper - public
|
||||
private final ChunkGenerator generator;
|
||||
private final WorldServer world;
|
||||
private final Random random = new Random();
|
||||
|
|
Loading…
Add table
Reference in a new issue