2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2019-09-16 02:20:02 +02:00
|
|
|
From: Byteflux <byte@byteflux.net>
|
|
|
|
Date: Wed, 2 Mar 2016 02:17:54 -0600
|
|
|
|
Subject: [PATCH] Generator Settings
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 515673e0fec1dc5c8a188d594f5c9b698c47d0e1..928fefb4195bd5d629b59b2b3c7d005b79bdf161 100644
|
2019-09-16 02:20:02 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2020-05-06 10:35:20 +02:00
|
|
|
@@ -606,4 +606,9 @@ public class PaperWorldConfig {
|
2019-09-16 02:20:02 +02:00
|
|
|
private void perPlayerMobSpawns() {
|
|
|
|
perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean generateFlatBedrock;
|
|
|
|
+ private void generatorSettings() {
|
|
|
|
+ generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index af81a841428a656bc4c4a23c9dcafb25e4c96ee2..2268fbdd8716233ce8f5a8a68d17a8a460a6685f 100644
|
2019-09-16 02:20:02 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
2019-12-12 17:20:43 +01:00
|
|
|
@@ -211,8 +211,8 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
2019-09-16 02:20:02 +02:00
|
|
|
int i = ichunkaccess.getPos().d();
|
|
|
|
int j = ichunkaccess.getPos().e();
|
|
|
|
T t0 = this.getSettings();
|
|
|
|
- int k = t0.u();
|
|
|
|
- int l = t0.t();
|
|
|
|
+ int k = t0.u(); final int floorHeight = k; // Paper
|
|
|
|
+ int l = t0.t(); final int roofHeight = l; // Paper
|
|
|
|
Iterator iterator = BlockPosition.b(i, 0, j, i + 15, 0, j + 15).iterator();
|
|
|
|
|
|
|
|
while (iterator.hasNext()) {
|
2019-12-12 17:20:43 +01:00
|
|
|
@@ -221,7 +221,7 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
2019-09-16 02:20:02 +02:00
|
|
|
|
|
|
|
if (l > 0) {
|
|
|
|
for (i1 = l; i1 >= l - 4; --i1) {
|
|
|
|
- if (i1 >= l - random.nextInt(5)) {
|
|
|
|
+ if (i1 >= (getWorld().paperConfig.generateFlatBedrock ? roofHeight : l - random.nextInt(5))) { // Paper - Configurable flat bedrock roof
|
|
|
|
ichunkaccess.setType(blockposition_mutableblockposition.d(blockposition.getX(), i1, blockposition.getZ()), Blocks.BEDROCK.getBlockData(), false);
|
|
|
|
}
|
|
|
|
}
|
2019-12-12 17:20:43 +01:00
|
|
|
@@ -229,7 +229,7 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
2019-09-16 02:20:02 +02:00
|
|
|
|
|
|
|
if (k < 256) {
|
|
|
|
for (i1 = k + 4; i1 >= k; --i1) {
|
|
|
|
- if (i1 <= k + random.nextInt(5)) {
|
2019-09-28 03:53:20 +02:00
|
|
|
+ if (i1 <= (getWorld().paperConfig.generateFlatBedrock ? floorHeight : k + random.nextInt(5))) { // Paper - Configurable flat bedrock floor
|
2019-09-16 02:20:02 +02:00
|
|
|
ichunkaccess.setType(blockposition_mutableblockposition.d(blockposition.getX(), i1, blockposition.getZ()), Blocks.BEDROCK.getBlockData(), false);
|
|
|
|
}
|
|
|
|
}
|