mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 06:48:23 +01:00
b2aaf31f9e
Removes ArmorStand Marker API as that was added to Bukkit
278 lines
No EOL
14 KiB
Diff
278 lines
No EOL
14 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Byteflux <byte@byteflux.net>
|
|
Date: Tue, 2 Jun 2015 00:41:23 -0700
|
|
Subject: [PATCH] Generator Settings
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- 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)) {
|
|
+ if (l1 <= (world.paperSpigotConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // PaperSpigot - Configurable flat bedrock
|
|
chunksnapshot.a(k1, l1, j1, Blocks.BEDROCK.getBlockData());
|
|
} 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
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- 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 {
|
|
chunksnapshot.a(l, l1, k, Blocks.STONE.getBlockData());
|
|
}
|
|
|
|
- if (l1 <= random.nextInt(5)) {
|
|
+ if (l1 <= (world.paperSpigotConfig.generateFlatBedrock ? 0 : random.nextInt(5))) { // PaperSpigot - Configurable flat bedrock
|
|
chunksnapshot.a(l, l1, k, Blocks.BEDROCK.getBlockData());
|
|
} else {
|
|
IBlockData iblockdata2 = chunksnapshot.a(l, l1, k);
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderFlat.java b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderFlat.java
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements IChunkProvider {
|
|
if (flag) {
|
|
Map map = this.d.b();
|
|
|
|
- if (map.containsKey("village")) {
|
|
+ if (map.containsKey("village") && world.paperSpigotConfig.generateVillage) { // PaperSpigot
|
|
Map map1 = (Map) map.get("village");
|
|
|
|
if (!map1.containsKey("size")) {
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements IChunkProvider {
|
|
this.e.add(new WorldGenVillage(map1));
|
|
}
|
|
|
|
- if (map.containsKey("biome_1")) {
|
|
+ if (map.containsKey("biome_1") && world.paperSpigotConfig.generateTemple) { // PaperSpigot
|
|
this.e.add(new WorldGenLargeFeature((Map) map.get("biome_1")));
|
|
}
|
|
|
|
- if (map.containsKey("mineshaft")) {
|
|
+ if (map.containsKey("mineshaft") && world.paperSpigotConfig.generateMineshaft) { // PaperSpigot
|
|
this.e.add(new WorldGenMineshaft((Map) map.get("mineshaft")));
|
|
}
|
|
|
|
- if (map.containsKey("stronghold")) {
|
|
+ if (map.containsKey("stronghold") && world.paperSpigotConfig.generateStronghold) { // PaperSpigot
|
|
this.e.add(new WorldGenStronghold((Map) map.get("stronghold")));
|
|
}
|
|
|
|
- if (map.containsKey("oceanmonument")) {
|
|
+ if (map.containsKey("oceanmonument") && world.paperSpigotConfig.generateMonument) { // PaperSpigot
|
|
this.e.add(new WorldGenMonument((Map) map.get("oceanmonument")));
|
|
}
|
|
}
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderFlat implements IChunkProvider {
|
|
this.i = new WorldGenLakes(Blocks.LAVA);
|
|
}
|
|
|
|
- this.g = this.d.b().containsKey("dungeon");
|
|
+ this.g = world.paperSpigotConfig.generateDungeon && this.d.b().containsKey("dungeon"); // PaperSpigot
|
|
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
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|
this.a(i, j, chunksnapshot);
|
|
this.B = this.m.getWorldChunkManager().getBiomeBlock(this.B, i * 16, j * 16, 16, 16);
|
|
this.a(i, j, chunksnapshot, this.B);
|
|
- if (this.r.r) {
|
|
+ if (this.r.r && this.m.paperSpigotConfig.generateCaves) { // PaperSpigot
|
|
this.u.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.z) {
|
|
+ if (this.r.z && this.m.paperSpigotConfig.generateCanyon) { // PaperSpigot
|
|
this.z.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.w && this.n) {
|
|
+ if (this.r.w && this.n && this.m.paperSpigotConfig.generateMineshaft) { // PaperSpigot
|
|
this.x.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.v && this.n) {
|
|
+ if (this.r.v && this.n && this.m.paperSpigotConfig.generateVillage) { // PaperSpigot
|
|
this.w.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.u && this.n) {
|
|
+ if (this.r.u && this.n && this.m.paperSpigotConfig.generateStronghold) { // PaperSpigot
|
|
this.v.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.x && this.n) {
|
|
+ if (this.r.x && this.n && this.m.paperSpigotConfig.generateTemple) { // PaperSpigot
|
|
this.y.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
- if (this.r.y && this.n) {
|
|
+ if (this.r.y && this.n && this.m.paperSpigotConfig.generateMonument) { // PaperSpigot
|
|
this.A.a(this, this.m, i, j, chunksnapshot);
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|
boolean flag = false;
|
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
|
|
|
|
- if (this.r.w && this.n) {
|
|
+ if (this.r.w && this.n && this.m.paperSpigotConfig.generateMineshaft) { // PaperSpigot
|
|
this.x.a(this.m, this.h, chunkcoordintpair);
|
|
}
|
|
|
|
- if (this.r.v && this.n) {
|
|
+ if (this.r.v && this.n && this.m.paperSpigotConfig.generateVillage) { // PaperSpigot
|
|
flag = this.w.a(this.m, this.h, chunkcoordintpair);
|
|
}
|
|
|
|
- if (this.r.u && this.n) {
|
|
+ if (this.r.u && this.n && this.m.paperSpigotConfig.generateStronghold) { // PaperSpigot
|
|
this.v.a(this.m, this.h, chunkcoordintpair);
|
|
}
|
|
|
|
- if (this.r.x && this.n) {
|
|
+ if (this.r.x && this.n && this.m.paperSpigotConfig.generateTemple) { // PaperSpigot
|
|
this.y.a(this.m, this.h, chunkcoordintpair);
|
|
}
|
|
|
|
- if (this.r.y && this.n) {
|
|
+ if (this.r.y && this.n && this.m.paperSpigotConfig.generateMonument) { // PaperSpigot
|
|
this.A.a(this.m, this.h, chunkcoordintpair);
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|
}
|
|
}
|
|
|
|
- if (this.r.s) {
|
|
+ if (this.r.s && this.m.paperSpigotConfig.generateDungeon) { // PaperSpigot
|
|
for (k1 = 0; k1 < this.r.t; ++k1) {
|
|
l1 = this.h.nextInt(16) + 8;
|
|
i2 = this.h.nextInt(256);
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderGenerate implements IChunkProvider {
|
|
}
|
|
|
|
public void recreateStructures(Chunk chunk, int i, int j) {
|
|
- if (this.r.w && this.n) {
|
|
+ if (this.r.w && this.n && this.m.paperSpigotConfig.generateMineshaft) { // PaperSpigot
|
|
this.x.a(this, this.m, i, j, (ChunkSnapshot) null);
|
|
}
|
|
|
|
- if (this.r.v && this.n) {
|
|
+ if (this.r.v && this.n && this.m.paperSpigotConfig.generateVillage) { // PaperSpigot
|
|
this.w.a(this, this.m, i, j, (ChunkSnapshot) null);
|
|
}
|
|
|
|
- if (this.r.u && this.n) {
|
|
+ if (this.r.u && this.n && this.m.paperSpigotConfig.generateStronghold) { // PaperSpigot
|
|
this.v.a(this, this.m, i, j, (ChunkSnapshot) null);
|
|
}
|
|
|
|
- if (this.r.x && this.n) {
|
|
+ if (this.r.x && this.n && this.m.paperSpigotConfig.generateTemple) { // PaperSpigot
|
|
this.y.a(this, this.m, i, j, (ChunkSnapshot) null);
|
|
}
|
|
|
|
- if (this.r.y && this.n) {
|
|
+ if (this.r.y && this.n && this.m.paperSpigotConfig.generateMonument) { // PaperSpigot
|
|
this.A.a(this, this.m, i, j, (ChunkSnapshot) null);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderHell.java b/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderHell.java
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderHell implements IChunkProvider {
|
|
IBlockData iblockdata1 = Blocks.NETHERRACK.getBlockData();
|
|
|
|
for (int l1 = 127; l1 >= 0; --l1) {
|
|
- if (l1 < 127 - this.j.nextInt(5) && l1 > this.j.nextInt(5)) {
|
|
+ // PaperSpigot start - Configurable flat bedrock worldgen
|
|
+ if (l1 < 127 - (h.paperSpigotConfig.generateFlatBedrock ? 0 : this.j.nextInt(5)) &&
|
|
+ l1 > (h.paperSpigotConfig.generateFlatBedrock ? 0 : this.j.nextInt(5))) {
|
|
+ // PaperSpigot end
|
|
IBlockData iblockdata2 = chunksnapshot.a(i1, l1, l);
|
|
|
|
if (iblockdata2.getBlock() != null && iblockdata2.getBlock().getMaterial() != Material.AIR) {
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderHell implements IChunkProvider {
|
|
|
|
this.a(i, j, chunksnapshot);
|
|
this.b(i, j, chunksnapshot);
|
|
- this.C.a(this, this.h, i, j, chunksnapshot);
|
|
- if (this.i) {
|
|
+ if (this.h.paperSpigotConfig.generateCaves) this.C.a(this, this.h, i, j, chunksnapshot); // PaperSpigot
|
|
+ if (this.i && this.h.paperSpigotConfig.generateFortress) { // PaperSpigot
|
|
this.B.a(this, this.h, i, j, chunksnapshot);
|
|
}
|
|
|
|
@@ -0,0 +0,0 @@ public class ChunkProviderHell implements IChunkProvider {
|
|
}
|
|
|
|
public void recreateStructures(Chunk chunk, int i, int j) {
|
|
- this.B.a(this, this.h, i, j, (ChunkSnapshot) null);
|
|
+ if (this.h.paperSpigotConfig.generateFortress) this.B.a(this, this.h, i, j, (ChunkSnapshot) null); // PaperSpigot
|
|
}
|
|
|
|
public Chunk getChunkAt(BlockPosition blockposition) {
|
|
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- 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 {
|
|
}
|
|
|
|
public boolean b(BlockPosition blockposition) {
|
|
+ if (this.c == null) return false; // PaperSpigot
|
|
this.a(this.c);
|
|
return this.c(blockposition) != null;
|
|
}
|
|
@@ -0,0 +0,0 @@ public abstract class StructureGenerator extends WorldGenBase {
|
|
}
|
|
|
|
public boolean a(World world, BlockPosition blockposition) {
|
|
+ if (this.c == null) return false; // PaperSpigot
|
|
this.a(world);
|
|
Iterator iterator = this.e.values().iterator();
|
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
|
|
loadUnloadedTNTEntities = getBoolean( "load-chunks.tnt-entities", false );
|
|
loadUnloadedFallingBlocks = getBoolean( "load-chunks.falling-blocks", false );
|
|
}
|
|
+
|
|
+ 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 );
|
|
+ }
|
|
}
|
|
--
|