--- a/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java +++ b/net/minecraft/world/level/levelgen/ChunkGeneratorAbstract.java @@ -76,7 +76,7 @@ protected final IBlockData defaultBlock; protected final IBlockData defaultFluid; private final long seed; - protected final Supplier settings; + public final Supplier settings; // PAIL protected -> public private final int height; private final NoiseSampler sampler; private final BaseStoneSource baseStoneSource; @@ -257,6 +257,19 @@ @Override public void buildBase(RegionLimitedWorldAccess regionlimitedworldaccess, IChunkAccess ichunkaccess) { + // CraftBukkit start - spilt surface and bedrock generation code + Random random = buildSurface(regionlimitedworldaccess, ichunkaccess); + buildBedrock(ichunkaccess, random); + } + + @Override + public void buildBedrock(IChunkAccess iChunkAccess, Random random) { + a(iChunkAccess, random); // PAIL rename setBedrock + } + + @Override + public SeededRandom buildSurface(RegionLimitedWorldAccess regionlimitedworldaccess, IChunkAccess ichunkaccess) { + // CraftBukkit end ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos(); int i = chunkcoordintpair.x; int j = chunkcoordintpair.z; @@ -281,7 +294,10 @@ } } - this.a(ichunkaccess, seededrandom); + // CraftBukkit start - spilt surface and bedrock generation code + // this.a(ichunkaccess, seededrandom); + return seededrandom; + // CraftBukkit end } private void a(IChunkAccess ichunkaccess, Random random) { @@ -403,16 +419,23 @@ BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); for (int i1 = 0; i1 < this.cellCountX; ++i1) { + // CraftBukkit start - decompile error + int i1Final = i1; list.forEach((noiseinterpolator1) -> { - noiseinterpolator1.a(i1); + noiseinterpolator1.a(i1Final); + // CraftBukkit end }); for (int j1 = 0; j1 < this.cellCountZ; ++j1) { ChunkSection chunksection = ichunkaccess.b(ichunkaccess.getSectionsCount() - 1); for (int k1 = j - 1; k1 >= 0; --k1) { + // CraftBukkit start - decompile error + int kiFinal = k1; + int j1Final = j1; list.forEach((noiseinterpolator1) -> { - noiseinterpolator1.a(k1, j1); + noiseinterpolator1.a(kiFinal, j1Final); + // CraftBukkit end }); for (int l1 = this.cellHeight - 1; l1 >= 0; --l1) {