3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 05:20:07 +01:00

Allow delegation to vanilla chunk gen

Dieser Commit ist enthalten in:
MiniDigger 2020-04-29 02:12:51 +02:00 committet von Aikar
Ursprung 40ace3f7b7
Commit adf1de586b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 401ADFC9891FAAFE

Datei anzeigen

@ -27,7 +27,7 @@ index b51613040e4583ff056060b47b1f97a86ebcde51..5366314e5f889b5b8d7740bbd0f024d9
for (int l = 0; l < k; ++l) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 56bf840e3d514153ed249093761ddcc04b282403..0d044ed6d7dd77e1dcc6c69a94afb74cb8b9971c 100644
index 56bf840e3d514153ed249093761ddcc04b282403..d8103ab0d542ced4f30b88ceb4fc4c3eedd5d9a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1972,6 +1972,29 @@ public final class CraftServer implements Server {
@ -46,9 +46,9 @@ index 56bf840e3d514153ed249093761ddcc04b282403..0d044ed6d7dd77e1dcc6c69a94afb74c
+ list.add(protoChunk);
+ 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 = ((CraftWorld) world).getHandle().worldProvider.getChunkGenerator();
+ net.minecraft.server.ChunkGenerator chunkGenerator = nmsWorld.getChunkProvider().chunkGenerator;
+ chunkGenerator.createBiomes(protoChunk);
+ chunkGenerator.buildNoise(genRegion, protoChunk);
+ chunkGenerator.buildNoise(genRegion, nmsWorld.getStructureManager(), protoChunk);
+ chunkGenerator.buildBase(genRegion, protoChunk);
+ // copy over generated sections
+ data.setRawChunkData(protoChunk.getSections());