From b1489ebf7fa9b7722b1695d3874d57d22dbf32a4 Mon Sep 17 00:00:00 2001 From: SprainedSpark89 <87820585+SprainedSpark89@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:35:23 -0800 Subject: [PATCH] Added generate lakes toggle I did this for CumbledHam this adds https://github.com/Moresteck/Project-Poseidon-Uberbukkit/issues/39 --- .../poseidon/PoseidonConfig.java | 1 + .../server/ChunkProviderGenerate.java | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/legacyminecraft/poseidon/PoseidonConfig.java b/src/main/java/com/legacyminecraft/poseidon/PoseidonConfig.java index cd680ce5..a00cf06f 100644 --- a/src/main/java/com/legacyminecraft/poseidon/PoseidonConfig.java +++ b/src/main/java/com/legacyminecraft/poseidon/PoseidonConfig.java @@ -184,6 +184,7 @@ private void write() { generateConfigOption("version.worldgen.generate_tallgrass", true); generateConfigOption("version.worldgen.ores.world.custom_seed", false); generateConfigOption("version.worldgen.ores.world.seed", 0L); + generateConfigOption("version.worldgen.generate_lakes", true); generateConfigOption("version.mechanics.tile_grass_drop_seeds", false); generateConfigOption("version.mechanics.flammable_fences_stairs", true); diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java index 6add6c8c..2b482ab6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java +++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java @@ -341,21 +341,24 @@ public void getChunkAt(IChunkProvider ichunkprovider, int i, int j) { int l1; int i2; - if (this.j.nextInt(4) == 0) { - k1 = k + this.j.nextInt(16) + 8; - l1 = this.j.nextInt(128); - i2 = l + this.j.nextInt(16) + 8; - (new WorldGenLakes(Block.STATIONARY_WATER.id)).a(this.p, this.j, k1, l1, i2); - } - - if (this.j.nextInt(8) == 0) { - k1 = k + this.j.nextInt(16) + 8; - l1 = this.j.nextInt(this.j.nextInt(120) + 8); - i2 = l + this.j.nextInt(16) + 8; - if (l1 < 64 || this.j.nextInt(10) == 0) { - (new WorldGenLakes(Block.STATIONARY_LAVA.id)).a(this.p, this.j, k1, l1, i2); - } - } + // uberbukkit + if (PoseidonConfig.getInstance().getBoolean("version.worldgen.generate_lakes", true)) { + if (this.j.nextInt(4) == 0) { + k1 = k + this.j.nextInt(16) + 8; + l1 = this.j.nextInt(128); + i2 = l + this.j.nextInt(16) + 8; + (new WorldGenLakes(Block.STATIONARY_WATER.id)).a(this.p, this.j, k1, l1, i2); + } + + if (this.j.nextInt(8) == 0) { + k1 = k + this.j.nextInt(16) + 8; + l1 = this.j.nextInt(this.j.nextInt(120) + 8); + i2 = l + this.j.nextInt(16) + 8; + if (l1 < 64 || this.j.nextInt(10) == 0) { + (new WorldGenLakes(Block.STATIONARY_LAVA.id)).a(this.p, this.j, k1, l1, i2); + } + } + } int j2;