Delegate to platformGenerator in deprecated generation method if applicable when using new generation methods (1.19)

This commit is contained in:
dordsor21 2022-06-10 16:44:17 +01:00
parent 84c9bb0d92
commit 307a1a6deb
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -278,9 +278,13 @@ public class BukkitPlotGenerator extends ChunkGenerator implements GeneratorWrap
@NonNull World world, @NonNull Random random, int x, int z, @NonNull BiomeGrid biome
) {
if (useNewGenerationMethods) {
if (this.platformGenerator != this) {
return this.platformGenerator.generateChunkData(world, random, x, z, biome);
} else {
// Return super as it will throw an exception caught by the server that will mean this method is no longer used.
return super.generateChunkData(world, random, x, z, biome);
}
}
int minY = BukkitWorld.getMinWorldHeight(world);
int maxY = BukkitWorld.getMaxWorldHeight(world);
GenChunk result = new GenChunk(minY, maxY);