2015-06-02 09:44:06 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Byteflux <byte@byteflux.net>
|
2016-03-01 00:09:49 +01:00
|
|
|
Date: Wed, 2 Mar 2016 02:17:54 -0600
|
2015-06-02 09:44:06 +02:00
|
|
|
Subject: [PATCH] Generator Settings
|
|
|
|
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2017-03-25 04:18:58 +01:00
|
|
|
index c00fa83d5..3b19b53a8 100644
|
2016-03-01 00:09:49 +01:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
|
|
|
disableEndCredits = getBoolean("game-mechanics.disable-end-credits", false);
|
|
|
|
log("End credits disabled: " + disableEndCredits);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public boolean generateCanyon;
|
|
|
|
+ public boolean generateCaves;
|
|
|
|
+ public boolean generateDungeon;
|
|
|
|
+ public boolean generateFortress;
|
|
|
|
+ public boolean generateMineshaft;
|
|
|
|
+ public boolean generateMonument;
|
|
|
|
+ public boolean generateStronghold;
|
|
|
|
+ public boolean generateTemple;
|
|
|
|
+ public boolean generateVillage;
|
|
|
|
+ public boolean generateFlatBedrock;
|
|
|
|
+
|
|
|
|
+ private void generatorSettings() {
|
|
|
|
+ generateCanyon = getBoolean("generator-settings.canyon", true);
|
|
|
|
+ generateCaves = getBoolean("generator-settings.caves", true);
|
|
|
|
+ generateDungeon = getBoolean("generator-settings.dungeon", true);
|
|
|
|
+ generateFortress = getBoolean("generator-settings.fortress", true);
|
|
|
|
+ generateMineshaft = getBoolean("generator-settings.mineshaft", true);
|
|
|
|
+ generateMonument = getBoolean("generator-settings.monument", true);
|
|
|
|
+ generateStronghold = getBoolean("generator-settings.stronghold", true);
|
|
|
|
+ generateTemple = getBoolean("generator-settings.temple", true);
|
|
|
|
+ generateVillage = getBoolean("generator-settings.village", true);
|
|
|
|
+ generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false);
|
|
|
|
+ }
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 1b7599769..ab6db7468 100644
|
2015-06-02 09:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class BiomeBase {
|
|
|
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
|
|
|
|
|
|
|
for (int l1 = 255; l1 >= 0; --l1) {
|
|
|
|
- if (l1 <= random.nextInt(5)) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (l1 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
|
|
|
|
chunksnapshot.a(k1, l1, j1, BiomeBase.c);
|
2015-06-02 09:44:06 +02:00
|
|
|
} else {
|
|
|
|
IBlockData iblockdata2 = chunksnapshot.a(k1, l1, j1);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeMesa.java b/src/main/java/net/minecraft/server/BiomeMesa.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index f2dd96a32..0541403f0 100644
|
2015-06-02 09:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/BiomeMesa.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/BiomeMesa.java
|
|
|
|
@@ -0,0 +0,0 @@ public class BiomeMesa extends BiomeBase {
|
2016-06-09 05:57:14 +02:00
|
|
|
chunksnapshot.a(l, i2, k, BiomeMesa.a);
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
2016-06-09 05:57:14 +02:00
|
|
|
- if (i2 <= random.nextInt(5)) {
|
|
|
|
+ if (i2 <= (world.paperConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // Paper - Configurable flat bedrock
|
|
|
|
chunksnapshot.a(l, i2, k, BiomeMesa.c);
|
2017-05-14 20:05:01 +02:00
|
|
|
} else if (l1 < 15 || this.I) {
|
2016-06-09 05:57:14 +02:00
|
|
|
IBlockData iblockdata2 = chunksnapshot.a(l, i2, k);
|
2015-06-02 09:44:06 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderFlat.java b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 1452ff657..8b1b79380 100644
|
2015-06-02 09:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
if (flag) {
|
|
|
|
Map map = this.d.b();
|
|
|
|
|
|
|
|
- if (map.containsKey("village")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (map.containsKey("village") && world.paperConfig.generateVillage) { // Paper
|
2015-06-02 09:44:06 +02:00
|
|
|
Map map1 = (Map) map.get("village");
|
|
|
|
|
|
|
|
if (!map1.containsKey("size")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
|
2016-11-17 03:23:38 +01:00
|
|
|
this.e.put("Village", new WorldGenVillage(map1));
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- if (map.containsKey("biome_1")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (map.containsKey("biome_1") && world.paperConfig.generateTemple) { // Paper
|
2016-11-17 03:23:38 +01:00
|
|
|
this.e.put("Temple", new WorldGenLargeFeature((Map) map.get("biome_1")));
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- if (map.containsKey("mineshaft")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (map.containsKey("mineshaft") && world.paperConfig.generateMineshaft) { // Paper
|
2016-11-17 03:23:38 +01:00
|
|
|
this.e.put("Mineshaft", new WorldGenMineshaft((Map) map.get("mineshaft")));
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- if (map.containsKey("stronghold")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (map.containsKey("stronghold") && world.paperConfig.generateStronghold) { // Paper
|
2016-11-17 03:23:38 +01:00
|
|
|
this.e.put("Stronghold", new WorldGenStronghold((Map) map.get("stronghold")));
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- if (map.containsKey("oceanmonument")) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (map.containsKey("oceanmonument") && world.paperConfig.generateMonument) { // Paper
|
2016-11-17 03:23:38 +01:00
|
|
|
this.e.put("Monument", new WorldGenMonument((Map) map.get("oceanmonument")));
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
}
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
this.i = new WorldGenLakes(Blocks.LAVA);
|
|
|
|
}
|
|
|
|
|
|
|
|
- this.g = this.d.b().containsKey("dungeon");
|
2016-03-01 00:09:49 +01:00
|
|
|
+ this.g = world.paperConfig.generateDungeon && this.d.b().containsKey("dungeon"); // Paper
|
2015-06-02 09:44:06 +02:00
|
|
|
int j = 0;
|
|
|
|
int k = 0;
|
|
|
|
boolean flag1 = true;
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 22a24a39f..ee9e00e64 100644
|
2015-06-02 09:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
this.a(i, j, chunksnapshot);
|
2016-11-17 03:23:38 +01:00
|
|
|
this.D = this.n.getWorldChunkManager().getBiomeBlock(this.D, i * 16, j * 16, 16, 16);
|
|
|
|
this.a(i, j, chunksnapshot, this.D);
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.r) {
|
|
|
|
+ if (this.s.r && this.n.paperConfig.generateCaves) { // Paper
|
|
|
|
this.v.a(this.n, i, j, chunksnapshot);
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
2016-11-17 03:23:38 +01:00
|
|
|
- if (this.s.A) {
|
|
|
|
+ if (this.s.A && this.n.paperConfig.generateCanyon) { // Paper
|
2016-03-01 00:09:49 +01:00
|
|
|
this.A.a(this.n, i, j, chunksnapshot);
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
if (this.o) {
|
|
|
|
- if (this.s.w) {
|
|
|
|
+ if (this.s.w && this.n.paperConfig.generateMineshaft) { // Paper
|
|
|
|
this.y.a(this.n, i, j, chunksnapshot);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.v) {
|
|
|
|
+ if (this.s.v&& this.n.paperConfig.generateVillage) { // Paper
|
|
|
|
this.x.a(this.n, i, j, chunksnapshot);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.u) {
|
|
|
|
+ if (this.s.u && this.n.paperConfig.generateStronghold) { // Paper
|
|
|
|
this.w.a(this.n, i, j, chunksnapshot);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.x) {
|
|
|
|
+ if (this.s.x && this.n.paperConfig.generateTemple) { // Paper
|
|
|
|
this.z.a(this.n, i, j, chunksnapshot);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.y) {
|
|
|
|
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
|
|
|
|
this.B.a(this.n, i, j, chunksnapshot);
|
|
|
|
}
|
2016-11-17 03:23:38 +01:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
if (this.o) {
|
|
|
|
- if (this.s.w) {
|
|
|
|
+ if (this.s.w && this.n.paperConfig.generateMineshaft) { // Paper
|
|
|
|
this.y.a(this.n, this.i, chunkcoordintpair);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.v) {
|
|
|
|
+ if (this.s.v && this.n.paperConfig.generateVillage) { // Paper
|
|
|
|
flag = this.x.a(this.n, this.i, chunkcoordintpair);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.u) {
|
|
|
|
+ if (this.s.u && this.n.paperConfig.generateStronghold) { // Paper
|
|
|
|
this.w.a(this.n, this.i, chunkcoordintpair);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.x) {
|
|
|
|
+ if (this.s.x && this.n.paperConfig.generateTemple) { // Paper
|
|
|
|
this.z.a(this.n, this.i, chunkcoordintpair);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.y) {
|
|
|
|
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
|
|
|
|
this.B.a(this.n, this.i, chunkcoordintpair);
|
|
|
|
}
|
2016-11-17 03:23:38 +01:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.s) {
|
|
|
|
+ if (this.s.s && this.n.paperConfig.generateDungeon) { // Paper
|
|
|
|
for (k1 = 0; k1 < this.s.t; ++k1) {
|
|
|
|
l1 = this.i.nextInt(16) + 8;
|
|
|
|
i2 = this.i.nextInt(256);
|
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
|
|
|
|
public void recreateStructures(Chunk chunk, int i, int j) {
|
2016-03-01 00:09:49 +01:00
|
|
|
if (this.o) {
|
|
|
|
- if (this.s.w) {
|
|
|
|
+ if (this.s.w && this.n.paperConfig.generateMineshaft) { // Paper
|
|
|
|
this.y.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.v) {
|
|
|
|
+ if (this.s.v && this.n.paperConfig.generateVillage) { // Paper
|
|
|
|
this.x.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.u) {
|
|
|
|
+ if (this.s.u && this.n.paperConfig.generateStronghold) { // Paper
|
|
|
|
this.w.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.x) {
|
|
|
|
+ if (this.s.x && this.n.paperConfig.generateTemple) { // Paper
|
|
|
|
this.z.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
}
|
2015-06-02 09:44:06 +02:00
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (this.s.y) {
|
|
|
|
+ if (this.s.y && this.n.paperConfig.generateMonument) { // Paper
|
|
|
|
this.B.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
}
|
2016-11-17 03:23:38 +01:00
|
|
|
|
2015-06-02 09:44:06 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderHell.java b/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 9f738749f..12bc10ff0 100644
|
2015-06-02 09:44:06 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
2016-03-01 00:09:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderHell implements ChunkGenerator {
|
|
|
|
IBlockData iblockdata1 = ChunkProviderHell.b;
|
2015-06-02 09:44:06 +02:00
|
|
|
|
|
|
|
for (int l1 = 127; l1 >= 0; --l1) {
|
2016-03-01 00:09:49 +01:00
|
|
|
- if (l1 < 127 - this.p.nextInt(5) && l1 > this.p.nextInt(5)) {
|
|
|
|
+ // Paper start - Configurable flat bedrock worldgen
|
|
|
|
+ if (l1 < 127 - (n.paperConfig.generateFlatBedrock ? 0 : this.p.nextInt(5)) &&
|
|
|
|
+ l1 > (n.paperConfig.generateFlatBedrock ? 0 : this.p.nextInt(5))) {
|
|
|
|
+ // Paper end
|
2015-06-02 09:44:06 +02:00
|
|
|
IBlockData iblockdata2 = chunksnapshot.a(i1, l1, l);
|
|
|
|
|
2016-03-01 00:09:49 +01:00
|
|
|
if (iblockdata2.getBlock() != null && iblockdata2.getMaterial() != Material.AIR) {
|
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderHell implements ChunkGenerator {
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void recreateStructures(Chunk chunk, int i, int j) {
|
2016-06-09 05:57:14 +02:00
|
|
|
- this.I.a(this.n, i, j, (ChunkSnapshot) null);
|
|
|
|
+ if (this.n.paperConfig.generateFortress) this.I.a(this.n, i, j, (ChunkSnapshot) null);
|
2015-06-02 09:44:06 +02:00
|
|
|
}
|
2016-03-01 00:09:49 +01:00
|
|
|
}
|
2015-06-02 10:40:46 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
2017-05-14 20:05:01 +02:00
|
|
|
index 2580a4cf6..078957aac 100644
|
2015-06-02 10:40:46 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
|
|
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
|
|
|
|
}
|
|
|
|
|
2016-11-17 03:23:38 +01:00
|
|
|
public boolean a(World world, BlockPosition blockposition) {
|
2016-03-01 00:09:49 +01:00
|
|
|
+ if (this.g == null) return false; // Paper
|
2015-06-02 11:08:51 +02:00
|
|
|
this.a(world);
|
2016-11-17 03:23:38 +01:00
|
|
|
ObjectIterator objectiterator = this.c.values().iterator();
|
2015-06-02 11:08:51 +02:00
|
|
|
|
2015-07-28 00:26:21 +02:00
|
|
|
--
|