13
0
geforkt von Mirrors/Paper

Fix flat bedrock (#6255)

Dieser Commit ist enthalten in:
Jake Potrebic 2021-07-23 14:18:10 -07:00
Ursprung d58099f73b
Commit eaaca77f42

Datei anzeigen

@ -135,23 +135,12 @@ diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGen
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -0,0 +0,0 @@ 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();
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..00000000000000000000000000000000
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);
}
}