mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 09:23:42 +01:00
57dd397155
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
56 lines
2.8 KiB
Diff
56 lines
2.8 KiB
Diff
From 290425bd369b23ac8a78758a5370a6025aa00252 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index fd3dbea628..e790326c9c 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -618,4 +618,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 af81a84142..2268fbdd87 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java
|
|
@@ -211,8 +211,8 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
|
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()) {
|
|
@@ -221,7 +221,7 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
|
|
|
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);
|
|
}
|
|
}
|
|
@@ -229,7 +229,7 @@ public abstract class ChunkGeneratorAbstract<T extends GeneratorSettingsDefault>
|
|
|
|
if (k < 256) {
|
|
for (i1 = k + 4; i1 >= k; --i1) {
|
|
- if (i1 <= k + random.nextInt(5)) {
|
|
+ if (i1 <= (getWorld().paperConfig.generateFlatBedrock ? floorHeight : k + random.nextInt(5))) { // Paper - Configurable flat bedrock floor
|
|
ichunkaccess.setType(blockposition_mutableblockposition.d(blockposition.getX(), i1, blockposition.getZ()), Blocks.BEDROCK.getBlockData(), false);
|
|
}
|
|
}
|
|
--
|
|
2.26.2
|
|
|