From 3ade0024de81b9dc4d0022b93ffee0d1f69eab89 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Mon, 24 Mar 2014 15:10:11 +0000 Subject: [PATCH] Added config options for flower generation. --- .../common/core/handler/BiomeDecorationHandler.java | 4 ++-- .../vazkii/botania/common/core/handler/ConfigHandler.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java b/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java index 69d08e751..8723436cb 100644 --- a/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/BiomeDecorationHandler.java @@ -24,12 +24,12 @@ public class BiomeDecorationHandler { @ForgeSubscribe(priority = EventPriority.LOWEST) public void onWorldDecoration(DecorateBiomeEvent.Decorate event) { if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS) - for(int i = 0; i < 3; i++) { + for(int i = 0; i < ConfigHandler.flowerQuantity; i++) { int x = event.chunkX + event.rand.nextInt(16) + 8; int z = event.chunkZ + event.rand.nextInt(16) + 8; int y = event.world.getTopSolidOrLiquidBlock(x, z); - for (int j = 0; j < 32; j++) { + for(int j = 0; j < ConfigHandler.flowerDensity; j++) { int x1 = x + event.rand.nextInt(8) - event.rand.nextInt(8); int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4); int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8); diff --git a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java index a132252be..b5572a36f 100644 --- a/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/MODSRC/vazkii/botania/common/core/handler/ConfigHandler.java @@ -28,6 +28,8 @@ public final class ConfigHandler { public static boolean subtlePowerSystem = false; public static boolean staticWandBeam = false; public static boolean overrideVanillaBlocks = true; + public static int flowerQuantity = 3; + public static int flowerDensity = 32; public static void loadConfig(File configFile) { config = new Configuration(configFile); @@ -50,6 +52,12 @@ public final class ConfigHandler { overrideVanillaBlocksProp.comment = "Set to false to remove the overriding of vanilla blocks (snow, red and yellow flowers). Setting this to false will remove the snow on flowers tweak."; overrideVanillaBlocks = overrideVanillaBlocksProp.getBoolean(true); + Property propFlowerQuantity = config.get(Configuration.CATEGORY_GENERAL, "worldgen.flower.quantity", 3); + flowerQuantity = propFlowerQuantity.getInt(3); + Property propFlowerDensity = config.get(Configuration.CATEGORY_GENERAL, "worldgen.flower.density", 32); + flowerQuantity = propFlowerDensity.getInt(32); + + // Block IDs LibBlockIDs.idFlower = loadBlock(LibBlockNames.FLOWER, LibBlockIDs.idFlower); LibBlockIDs.idAltar = loadBlock(LibBlockNames.ALTAR, LibBlockIDs.idAltar);