From 37f32da8f8994d32e11e8c3637d66755918f3a25 Mon Sep 17 00:00:00 2001 From: konsolas Date: Wed, 12 Feb 2020 17:58:50 +0000 Subject: [PATCH] SPIGOT-5573, SPIGOT-5574: Move CustomChunkGenerator generation code back to buildBase() --- .../generator/CustomChunkGenerator.java | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java index 87512c6538..79a0513ac9 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -99,11 +99,6 @@ public class CustomChunkGenerator extends InternalChunkGenerator C getFeatureConfiguration(BiomeBase biomebase, StructureGenerator structuregenerator) { return (C) delegate.getFeatureConfiguration(biomebase, structuregenerator); @@ -125,7 +120,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator chunkgenerator, DefinedStructureManager definedstructuremanager) { + public void buildBase(RegionLimitedWorldAccess regionlimitedworldaccess, IChunkAccess ichunkaccess) { // Call the bukkit ChunkGenerator before structure generation so correct biome information is available. int x = ichunkaccess.getPos().x; int z = ichunkaccess.getPos().z; @@ -176,23 +171,14 @@ public class CustomChunkGenerator extends InternalChunkGenerator chunkgenerator, DefinedStructureManager definedstructuremanager) { if (generator.shouldGenerateStructures()) { - // Vanilla only uses biome at block 9 (see createStructures). - // We don't use BiomeGrid as another aspect of generation may try and get from a chunk somewhere else. - final BiomeBase biome = biomegrid.biome.getBiome(9 >> 2, 0, 9 >> 2); - delegate.createStructures(new BiomeManager(null, 0, null) { - - @Override - public BiomeManager a(WorldChunkManager worldchunkmanager) { - return this; - } - - @Override - public BiomeBase a(BlockPosition blockposition) { - return biome; - } - }, ichunkaccess, chunkgenerator, definedstructuremanager); + // Still need a way of getting the biome of this chunk to pass to createStructures + // Using default biomes for now. + delegate.createStructures(biomemanager, ichunkaccess, chunkgenerator, definedstructuremanager); } }