From b6bc8acf6b8de9a1831541602ee5d3f4a1d5ae91 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Thu, 9 Dec 2021 12:31:56 +0300 Subject: [PATCH] Vertical biomes size config --- .../ru/bclib/world/generator/BCLibNetherBiomeSource.java | 9 ++++++++- .../java/ru/bclib/world/generator/GeneratorOptions.java | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java index 50f629a2..a2089c7e 100644 --- a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java @@ -146,7 +146,14 @@ public class BCLibNetherBiomeSource extends BiomeSource { boolean useLegacy = GeneratorOptions.useOldBiomeGenerator() || forceLegacyGenerator; TriFunction mapConstructor = useLegacy ? SquareBiomeMap::new : HexBiomeMap::new; if (worldHeight > 128 && GeneratorOptions.useVerticalBiomes()) { - this.biomeMap = new MapStack(seed, GeneratorOptions.getBiomeSizeNether(), BiomeAPI.NETHER_BIOME_PICKER, 86, worldHeight, mapConstructor); + this.biomeMap = new MapStack( + seed, + GeneratorOptions.getBiomeSizeNether(), + BiomeAPI.NETHER_BIOME_PICKER, + GeneratorOptions.getVerticalBiomeSizeNether(), + worldHeight, + mapConstructor + ); } else { this.biomeMap = mapConstructor.apply(seed, GeneratorOptions.getBiomeSizeNether(), BiomeAPI.NETHER_BIOME_PICKER); diff --git a/src/main/java/ru/bclib/world/generator/GeneratorOptions.java b/src/main/java/ru/bclib/world/generator/GeneratorOptions.java index f241c021..89ea2084 100644 --- a/src/main/java/ru/bclib/world/generator/GeneratorOptions.java +++ b/src/main/java/ru/bclib/world/generator/GeneratorOptions.java @@ -8,6 +8,7 @@ import java.util.function.Function; public class GeneratorOptions { private static int biomeSizeNether; + private static int biomeVSizeNether; private static int biomeSizeEndLand; private static int biomeSizeEndVoid; private static Function endLandFunction; @@ -21,6 +22,7 @@ public class GeneratorOptions { public static void init() { biomeSizeNether = Configs.GENERATOR_CONFIG.getInt("nether.biomeMap", "biomeSize", 256); + biomeVSizeNether = Configs.GENERATOR_CONFIG.getInt("nether.biomeMap", "biomeVerticalSize(onlyInTallNether)", 86); biomeSizeEndLand = Configs.GENERATOR_CONFIG.getInt("end.biomeMap", "biomeSizeLand", 256); biomeSizeEndVoid = Configs.GENERATOR_CONFIG.getInt("end.biomeMap", "biomeSizeVoid", 256); customNetherBiomeSource = Configs.GENERATOR_CONFIG.getBoolean("options", "customNetherBiomeSource", true); @@ -35,6 +37,10 @@ public class GeneratorOptions { return Mth.clamp(biomeSizeNether, 1, 8192); } + public static int getVerticalBiomeSizeNether() { + return Mth.clamp(biomeVSizeNether, 1, 8192); + } + public static int getBiomeSizeEndLand() { return Mth.clamp(biomeSizeEndLand, 1, 8192); }