mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 05:02:30 +00:00
Added config options for flower generation.
This commit is contained in:
1 parent
5f588b04be
commit
3ade0024de
2 files changed
+10
-2
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user