From b173db62312c65d50d34503570548078f93a39b5 Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Fri, 23 Jul 2021 14:18:10 -0700 Subject: [PATCH] Fix flat bedrock (#6255) --- patches/server/0344-Generator-Settings.patch | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/patches/server/0344-Generator-Settings.patch b/patches/server/0344-Generator-Settings.patch index f4042dce8..0647b2cb4 100644 --- a/patches/server/0344-Generator-Settings.patch +++ b/patches/server/0344-Generator-Settings.patch @@ -132,26 +132,15 @@ index ea3279113358b41281ee2e92f2371a0f1e36b472..575f0bcb4db4bd58c949acc3b6a15bbe protochunk.setBiomes(biomestorage); object = protochunk; diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java -index 4e7e2a3d9135765701c9a74bf6c155539ebb969e..43efd756dec0dddcbcb18bcc2c48972f236ffda9 100644 +index 4e7e2a3d9135765701c9a74bf6c155539ebb969e..b906895e1db3f0b5654694796cd87bfe4cdd09c7 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java +++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java -@@ -270,8 +270,8 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { - int j = chunk.getPos().getMinBlockZ(); - NoiseGeneratorSettings noiseGeneratorSettings = this.settings.get(); - int k = noiseGeneratorSettings.noiseSettings().minY(); -- int l = k + noiseGeneratorSettings.getBedrockFloorPosition(); -- int m = this.height - 1 + k - noiseGeneratorSettings.getBedrockRoofPosition(); -+ int l = k + noiseGeneratorSettings.getBedrockFloorPosition(); final int floorHeight = k; // Paper -+ int m = this.height - 1 + k - noiseGeneratorSettings.getBedrockRoofPosition(); final int roofHeight = l; // Paper - int n = 5; - int o = chunk.getMinBuildHeight(); - int p = chunk.getMaxBuildHeight(); @@ -281,7 +281,7 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator { for(BlockPos blockPos : BlockPos.betweenClosed(i, 0, j, i + 15, 0, j + 15)) { if (bl) { for(int q = 0; q < 5; ++q) { - if (q <= random.nextInt(5)) { -+ if (q <= (chunk.generateFlatBedrock() ? roofHeight : random.nextInt(5))) { // Paper - Configurable flat bedrock roof ++ if (q <= (chunk.generateFlatBedrock() ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock roof chunk.setBlockState(mutableBlockPos.set(blockPos.getX(), m - q, blockPos.getZ()), Blocks.BEDROCK.defaultBlockState(), false); } } @@ -160,7 +149,7 @@ index 4e7e2a3d9135765701c9a74bf6c155539ebb969e..43efd756dec0dddcbcb18bcc2c48972f if (bl2) { for(int r = 4; r >= 0; --r) { - if (r <= random.nextInt(5)) { -+ if (r <= (chunk.generateFlatBedrock() ? roofHeight : random.nextInt(5))) { // Paper - Configurable flat bedrock floor ++ if (r <= (chunk.generateFlatBedrock() ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock floor chunk.setBlockState(mutableBlockPos.set(blockPos.getX(), l + r, blockPos.getZ()), Blocks.BEDROCK.defaultBlockState(), false); } }