From 26acc9b77a7a55d58721f73a57e154081c248f76 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 15 Sep 2019 19:20:02 -0500 Subject: [PATCH] Re-add flat bedrock config option --- .../0416-Generator-Settings.patch | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Spigot-Server-Patches/0416-Generator-Settings.patch diff --git a/Spigot-Server-Patches/0416-Generator-Settings.patch b/Spigot-Server-Patches/0416-Generator-Settings.patch new file mode 100644 index 0000000000..09b0bcfe39 --- /dev/null +++ b/Spigot-Server-Patches/0416-Generator-Settings.patch @@ -0,0 +1,56 @@ +From e81f6f82671a8ba544fb149c266b70c2bc701cf2 Mon Sep 17 00:00:00 2001 +From: Byteflux +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 +index 246bb4b01..29fd49968 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -620,4 +620,9 @@ public class PaperWorldConfig { + 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 +index 096866b2b..0e104c8c1 100644 +--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java ++++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +@@ -198,8 +198,8 @@ public abstract class ChunkGeneratorAbstract + 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()) { +@@ -208,7 +208,7 @@ public abstract class ChunkGeneratorAbstract + + 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); + } + } +@@ -216,7 +216,7 @@ public abstract class ChunkGeneratorAbstract + + if (k < 256) { + for (i1 = k + 4; i1 >= k; --i1) { +- if (i1 <= k + random.nextInt(5)) { ++ if (i1 <= (getWorld().paperConfig.generateFlatBedrock ? floorHeight : this.k + random.nextInt(5))) { // Paper - Configurable flat bedrock floor + ichunkaccess.setType(blockposition_mutableblockposition.d(blockposition.getX(), i1, blockposition.getZ()), Blocks.BEDROCK.getBlockData(), false); + } + } +-- +2.23.0 +