#252 Add debug.conf with option to generate hives everywhere

This commit is contained in:
mezz committed 2014-10-04 03:27:57 -07:00
1 parent 814e48ba5a
commit 056dc75fab
2 files changed
+23 -1

No files matched your search

@@ -15,6 +15,7 @@ import forestry.api.apiculture.hives.HiveManager;
import forestry.api.apiculture.hives.IHive;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.core.config.Config;
import forestry.core.config.Defaults;
import net.minecraft.block.Block;
import net.minecraft.world.World;
@@ -56,7 +57,10 @@ public class HiveDecorator {
private void decorateHives(World world, Random rand, int worldX, int worldZ) {
for (IHive hive : HiveManager.getHives())
genHive(world, rand, worldX, worldZ, hive);
if (Config.generateBeehivesDebug)
genHiveDebug(world, worldX, worldZ, hive);
else
genHive(world, rand, worldX, worldZ, hive);
}
private void genHive(World world, Random rand, int worldX, int worldZ, IHive hive) {
@@ -78,6 +82,18 @@ public class HiveDecorator {
}
}
private void genHiveDebug(World world, int worldX, int worldZ, IHive hive) {
BiomeGenBase biome = world.getBiomeGenForCoords(worldX, worldZ);
EnumHumidity humidity = EnumHumidity.getFromValue(biome.rainfall);
if (!hive.isGoodBiome(biome) || !hive.isGoodHumidity(humidity))
return;
for (int x = 0; x < 16; x++)
for (int z = 0; z < 16; z++)
tryGenHive(world, worldX + x, worldZ + z, hive);
}
private boolean tryGenHive(World world, int x, int z, IHive hive) {
int y = hive.getYForHive(world, x, z);
@@ -27,6 +27,7 @@ import forestry.core.triggers.ForestryTrigger;
public class Config {
public static final String CATEGORY_COMMON = "common";
public static final String CATEGORY_DEBUG = "debug";
public static Configuration config;
@@ -57,6 +58,7 @@ public class Config {
public static boolean generateTinOre = true;
public static boolean generateBeehives = true;
public static boolean generateBogEarth = false;
public static boolean generateBeehivesDebug = false;
// Performance
public static boolean enableBackpackResupply = true;
@@ -148,6 +150,10 @@ public class Config {
genBeehives.Comment = "set to false to force forestry to skip generating beehives in the world";
generateBeehives = Boolean.parseBoolean(genBeehives.Value);
Property genDebugBeehives = config.get("world.generate.beehives.debug", CATEGORY_DEBUG, false);
genDebugBeehives.Comment = "Set to true to force Forestry to try to generate a beehive at every possible location.";
generateBeehivesDebug = Boolean.parseBoolean(genDebugBeehives.Value);
Property genCopperOre = config.get("world.generate.copper", CATEGORY_COMMON, true);
genCopperOre.Comment = "set to false to force forestry to skip generating own copper ore blocks in the world";
generateCopperOre = Boolean.parseBoolean(genCopperOre.Value);